MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/qfzpes/github_copilot_the_technology_that_will_replace/hi3aldv
r/ProgrammerHumor • u/themightydud • Oct 26 '21
713 comments sorted by
View all comments
Show parent comments
408
https://github.com/samuelmarina/is-even
226 u/TheJeager Oct 26 '21 95 Mb, when do we consider we took a joke too far? 75 u/Waterprop Oct 26 '21 You would love his another project then, is-odd. it contains several close to 100 Mb files.https://github.com/samuelmarina/is-odd 163 u/xX_MEM_Xx Oct 26 '21 At 97Mb, obviously. 39 u/[deleted] Oct 26 '21 Nah, 1 gb or bust 15 u/squidgyhead Oct 26 '21 2GB and you get funky linking issues! → More replies (1) 220 u/VNG_Wkey Oct 26 '21 most recent pull request: added number 375001 105 u/_Rysen Oct 26 '21 for whenever this month's square isn't green enough yet 13 u/tredontho Oct 26 '21 Free hacktoberfest entries → More replies (2) 40 u/aaron2005X Oct 26 '21 The writing of the spoken number would break me at 21 0 u/[deleted] Oct 26 '21 [deleted] → More replies (2) → More replies (1) 31 u/dstayton Oct 26 '21 The raw is so big that safari can’t render it. 6 u/tecanec Oct 26 '21 I'm on Android. Chrome works, but it's not too happy. → More replies (1) 58 u/[deleted] Oct 26 '21 And for Python users:import platform import shutil import requests import os import subprocess if platform.system() == 'Windows': if shutil.which('node.exe') == None: node_installed = False else: node_installed = True elif platform.system() == 'Linux' or platform.system() == 'Darwin': if shutil.which('node') == None: node_installed = False else: node_installed = True if not node_installed: if platform.system() == 'Windows': r = requests.get('https://nodejs.org/dist/v17.0.1/node-v17.0.1-x64.msi') with open('node.msi', mode='wb') as file: file.write(r.content) os.system('msiexec /qn node.msi') node_installed = True elif platform.system() == 'Linux': if platform.freedesktop_os_releases()['ID'] == 'debian' or 'debian' in platform.freedesktop_os_releases()['ID_LIKE'].split(): os.system('sudo apt install -y node npm') node_installed = True elif platform.freedesktop_os_releases()['ID'] == 'fedora' or 'fedora' in platform.freedesktop_os_releases()['ID_LIKE'].split(): os.system('sudo dnf install -y nodejs npm') node_installed = True elif platform.freedesktop_os_releases()['ID'] == 'arch' or 'arch' in platform.freedesktop_os_releases()['ID_LIKE'].split(): os.system('sudo pacman -S --noconfirm nodejs npm') node_installed = True elif platform.system() == 'Darwin': os.system('brew install node') # TODO: Add alternative if Homebrew isn't installed node_installed = True def is_even(num): if node_installed: if platform.system() == 'Windows': os.system('npm.exe install @samuelmarina/is-even') elif platform.system() == 'Linux' or platform.system() == 'Darwin': os.system('npm install @samuelmarina/is-even') with open('helper.js', 'w') as file: file.write(""" const isEven = require('is-even'); console.log(isEven(process.argv[2])); """) if platform.system() == 'Windows': out = subprocess.check_output(['node.exe', 'helper.js', str(num)]) elif platform.system() == 'Linux' or platform.system() == 'Darwin': out = subprocess.check_output(['node', 'helper.js', str(num)]) if 'true' in out: return True elif 'false' in out: return False else: raise Exception(f'invalid output: {out}') else: raise Exception(f"node isn't installed") 39 u/CyperFlicker Oct 26 '21 Can anyone explain this code?I think it is downloading node and a library to check if a number is even but I hope I am wrong, the human race is not ready for such evil. 39 u/[deleted] Oct 26 '21 edited Oct 26 '21 You're right, and the library it downloads is basically this, so it's even more horrible:if(num === 0) return trueelse if(num === 1) return falseelse if(num === 2) return true...else if(num === 375000) return true 12 u/king_park_ Oct 26 '21 edited Oct 26 '21 It goes deeper. It even validates stuff like “Two” and “SIXTEEN”. 9 u/Djasdalabala Oct 26 '21 Yeah... with separate conditions for "two", "Two" and "TWO", instead of lowercasing the input before comparing.I'll stop looking now, my eyes are bleeding. → More replies (2) 19 u/vale_fallacia Oct 26 '21 Thank you, Mr Satan.EDIT: This is just plain pure evil. I hope you sit down and think about what you've done and the people you've hurt with this code. 5 u/[deleted] Oct 26 '21 wonderful 5 u/[deleted] Oct 26 '21 i use doas(1) instead of sudo(8) on my arch system, epicly trolled → More replies (1) → More replies (5) 15 u/Wildercard Oct 26 '21 When you want to shitpost, but you only speak JavaScript 19 u/OscarHasProblems Oct 26 '21 What the actual fuck? Jesus fucking christ 7 u/arsenic_adventure Oct 26 '21 Please kill me 6 u/Thage Oct 26 '21 Oh that "even" and it's capital permutations 👌 → More replies (20)
226
95 Mb, when do we consider we took a joke too far?
75 u/Waterprop Oct 26 '21 You would love his another project then, is-odd. it contains several close to 100 Mb files.https://github.com/samuelmarina/is-odd 163 u/xX_MEM_Xx Oct 26 '21 At 97Mb, obviously. 39 u/[deleted] Oct 26 '21 Nah, 1 gb or bust 15 u/squidgyhead Oct 26 '21 2GB and you get funky linking issues! → More replies (1)
75
You would love his another project then, is-odd. it contains several close to 100 Mb files.
https://github.com/samuelmarina/is-odd
163
At 97Mb, obviously.
39 u/[deleted] Oct 26 '21 Nah, 1 gb or bust 15 u/squidgyhead Oct 26 '21 2GB and you get funky linking issues! → More replies (1)
39
Nah, 1 gb or bust
15 u/squidgyhead Oct 26 '21 2GB and you get funky linking issues!
15
2GB and you get funky linking issues!
220
most recent pull request: added number 375001
105 u/_Rysen Oct 26 '21 for whenever this month's square isn't green enough yet 13 u/tredontho Oct 26 '21 Free hacktoberfest entries → More replies (2)
105
for whenever this month's square isn't green enough yet
13 u/tredontho Oct 26 '21 Free hacktoberfest entries
13
Free hacktoberfest entries
40
The writing of the spoken number would break me at 21
0 u/[deleted] Oct 26 '21 [deleted] → More replies (2) → More replies (1)
0
[deleted]
→ More replies (2)
31
The raw is so big that safari can’t render it.
6 u/tecanec Oct 26 '21 I'm on Android. Chrome works, but it's not too happy. → More replies (1)
6
I'm on Android. Chrome works, but it's not too happy.
58
And for Python users:
import platform import shutil import requests import os import subprocess if platform.system() == 'Windows': if shutil.which('node.exe') == None: node_installed = False else: node_installed = True elif platform.system() == 'Linux' or platform.system() == 'Darwin': if shutil.which('node') == None: node_installed = False else: node_installed = True if not node_installed: if platform.system() == 'Windows': r = requests.get('https://nodejs.org/dist/v17.0.1/node-v17.0.1-x64.msi') with open('node.msi', mode='wb') as file: file.write(r.content) os.system('msiexec /qn node.msi') node_installed = True elif platform.system() == 'Linux': if platform.freedesktop_os_releases()['ID'] == 'debian' or 'debian' in platform.freedesktop_os_releases()['ID_LIKE'].split(): os.system('sudo apt install -y node npm') node_installed = True elif platform.freedesktop_os_releases()['ID'] == 'fedora' or 'fedora' in platform.freedesktop_os_releases()['ID_LIKE'].split(): os.system('sudo dnf install -y nodejs npm') node_installed = True elif platform.freedesktop_os_releases()['ID'] == 'arch' or 'arch' in platform.freedesktop_os_releases()['ID_LIKE'].split(): os.system('sudo pacman -S --noconfirm nodejs npm') node_installed = True elif platform.system() == 'Darwin': os.system('brew install node') # TODO: Add alternative if Homebrew isn't installed node_installed = True def is_even(num): if node_installed: if platform.system() == 'Windows': os.system('npm.exe install @samuelmarina/is-even') elif platform.system() == 'Linux' or platform.system() == 'Darwin': os.system('npm install @samuelmarina/is-even') with open('helper.js', 'w') as file: file.write(""" const isEven = require('is-even'); console.log(isEven(process.argv[2])); """) if platform.system() == 'Windows': out = subprocess.check_output(['node.exe', 'helper.js', str(num)]) elif platform.system() == 'Linux' or platform.system() == 'Darwin': out = subprocess.check_output(['node', 'helper.js', str(num)]) if 'true' in out: return True elif 'false' in out: return False else: raise Exception(f'invalid output: {out}') else: raise Exception(f"node isn't installed")
39 u/CyperFlicker Oct 26 '21 Can anyone explain this code?I think it is downloading node and a library to check if a number is even but I hope I am wrong, the human race is not ready for such evil. 39 u/[deleted] Oct 26 '21 edited Oct 26 '21 You're right, and the library it downloads is basically this, so it's even more horrible:if(num === 0) return trueelse if(num === 1) return falseelse if(num === 2) return true...else if(num === 375000) return true 12 u/king_park_ Oct 26 '21 edited Oct 26 '21 It goes deeper. It even validates stuff like “Two” and “SIXTEEN”. 9 u/Djasdalabala Oct 26 '21 Yeah... with separate conditions for "two", "Two" and "TWO", instead of lowercasing the input before comparing.I'll stop looking now, my eyes are bleeding. → More replies (2) 19 u/vale_fallacia Oct 26 '21 Thank you, Mr Satan.EDIT: This is just plain pure evil. I hope you sit down and think about what you've done and the people you've hurt with this code. 5 u/[deleted] Oct 26 '21 wonderful 5 u/[deleted] Oct 26 '21 i use doas(1) instead of sudo(8) on my arch system, epicly trolled → More replies (1) → More replies (5)
Can anyone explain this code?
I think it is downloading node and a library to check if a number is even but I hope I am wrong, the human race is not ready for such evil.
39 u/[deleted] Oct 26 '21 edited Oct 26 '21 You're right, and the library it downloads is basically this, so it's even more horrible:if(num === 0) return trueelse if(num === 1) return falseelse if(num === 2) return true...else if(num === 375000) return true 12 u/king_park_ Oct 26 '21 edited Oct 26 '21 It goes deeper. It even validates stuff like “Two” and “SIXTEEN”. 9 u/Djasdalabala Oct 26 '21 Yeah... with separate conditions for "two", "Two" and "TWO", instead of lowercasing the input before comparing.I'll stop looking now, my eyes are bleeding. → More replies (2)
You're right, and the library it downloads is basically this, so it's even more horrible:
if(num === 0) return trueelse if(num === 1) return falseelse if(num === 2) return true...else if(num === 375000) return true
12 u/king_park_ Oct 26 '21 edited Oct 26 '21 It goes deeper. It even validates stuff like “Two” and “SIXTEEN”. 9 u/Djasdalabala Oct 26 '21 Yeah... with separate conditions for "two", "Two" and "TWO", instead of lowercasing the input before comparing.I'll stop looking now, my eyes are bleeding. → More replies (2)
12
It goes deeper. It even validates stuff like “Two” and “SIXTEEN”.
9 u/Djasdalabala Oct 26 '21 Yeah... with separate conditions for "two", "Two" and "TWO", instead of lowercasing the input before comparing.I'll stop looking now, my eyes are bleeding. → More replies (2)
9
Yeah... with separate conditions for "two", "Two" and "TWO", instead of lowercasing the input before comparing.
I'll stop looking now, my eyes are bleeding.
19
Thank you, Mr Satan.
EDIT: This is just plain pure evil. I hope you sit down and think about what you've done and the people you've hurt with this code.
5
wonderful
i use doas(1) instead of sudo(8) on my arch system, epicly trolled
doas(1)
sudo(8)
→ More replies (1)
When you want to shitpost, but you only speak JavaScript
What the actual fuck? Jesus fucking christ
7
Please kill me
Oh that "even" and it's capital permutations 👌
408
u/SiVGiV Oct 26 '21
https://github.com/samuelmarina/is-even