(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo OFF | |
rem How to run a Python script in a given conda environment from a batch file. | |
rem It doesn't require: | |
rem - conda to be in the PATH | |
rem - cmd.exe to be initialized with conda init | |
rem Define here the path to your conda installation | |
set CONDAPATH=C:\ProgramData\Miniconda3 | |
rem Define here the name of the environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//10x programmers (this shitpost took a fucking hour, wtf): | |
const rl = require('readline').createInterface({ | |
input: process.stdin, output: process.stdout | |
}); | |
let table = {}; | |
const q = (prompt, key) => () => new Promise(res => rl.question(prompt, answer => res(Object.assign(table, { [key]: answer })) )); | |
Promise.resolve() | |
.then(q('what is your name?', 'name')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
def thanos_sort(array): | |
while not is_sorted(array): | |
target_length = int(len(array)/2) | |
while len(array) > target_length: | |
del array[randint(0, len(array)-1)] | |
return array | |
def is_sorted(array): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Twitch chat browsersource CSS for OBS | |
Original by twitch.tv/starvingpoet modified by github.com/Bluscream | |
Just set the URL as either one of | |
- https://www.twitch.tv/%%TWITCHCHANNEL%%/chat?popout=true | |
- https://www.twitch.tv/popout/%%TWITCHCHANNEL%%/chat | |
- https://www.twitch.tv/embed/%%TWITCHCHANNEL%%/chat?parent=localhost | |
And paste this entire file into the CSS box or paste direct import css like |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image_path = "HOPE.png" | |
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib import pyplot | |
from PIL import Image | |
fig = pyplot.figure() | |
axis = fig.add_subplot(1, 1, 1, projection="3d") # 3D plot with scalar values in each axis | |
im = Image.open(image_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
im=Image.open("1.jpg") | |
#im=im.rotate(1) | |
im.save("e.jpg") | |
im2=im.convert("L") | |
im2.save("b.jpg") | |
threshold = 100 | |
im = im2.point(lambda p: p > threshold and 255) | |
im.save("d.jpg") | |
img="d.jpg" | |
result = tesseract.ProcessPagesWrapper(img,api) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |