SPC q q
- quitSPC w /
- split window verticallySPC w
- - split window horizontallySPC 1
- switch to window 1SPC 2
- switch to window 2SPC w c
- delete current windowSPC TAB
- switch to previous bufferSPC b b
- switch buffers
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 selenium import webdriver | |
from selenium.webdriver.firefox.options import Options | |
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary | |
options = Options() | |
options.set_headless(True) | |
binary = FirefoxBinary("/usr/bin/firefox") #Linux. In Windows/Mac this is different | |
driver = webdriver.Firefox(firefox_options=options, firefox_binary=binary) | |
print("started firefox in headless mode") |
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
#!/usr/bin/python3 | |
import os | |
import sys | |
from random import choice | |
if len(sys.argv) > 1 and sys.argv[1] == "show": | |
from subprocess import Popen, PIPE | |
import webbrowser |
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
r = requests.get(url, headers={ | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36' | |
}) |
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
#include <chrono> | |
/* | |
* ... | |
*/ | |
auto start = std::chrono::high_resolution_clock::now(); | |
/* | |
* do stuff | |
*/ |
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
#include <fstream> | |
//STUFF | |
std::ofstream fileout; | |
fileout.open("filename.txt", std::ios_base::app); | |
fileout << "hello world"; | |
//STUFF |
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
wget --recursive -e robots=off --random-wait --user-agent=Mozilla/5.0 http://example.com |
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
valgrind --tool=callgrind ./{} | |
./gprof2dot.py -f callgrind callgrind.out.{} | dot -Tsvg -o output.svg |
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
sudo dd bs=4M if={PATH_TO_ISO} of=/dev/{DEVICE} conv=fdatasync status=progress |
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
w, h = 8, 8 | |
fig, ax = plt.subplots(w, h, sharex='col', sharey='row', figsize=(20,20)) | |
for i in range(w*h): | |
a = ax[i//h][i%w] | |
plt.show() |
OlderNewer