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
// sync_scrape.js (tested with node 11.3) | |
const request = require("sync-request"); | |
const fetchUrl = url => { | |
console.time(`fetchUrl(${url})`); | |
const html = request("GET", url).getBody(); | |
console.timeEnd(`fetchUrl(${url})`); | |
return html; | |
}; |
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
# sync_scrape.py (needs Python 3.7+) | |
import time, re, requests | |
def fetch_url(url): | |
t = time.perf_counter() | |
html = requests.get(url).text | |
print(f"time of fetch_url({url}): {time.perf_counter() - t:.2f}s") | |
return html | |
def scrape_data(html): |
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
REGEDIT4 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00 |
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
REGEDIT4 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00 |
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
#!/bin/cat | |
# Intro to using UNIX Screen | |
## Basics | |
screen -list # LIST current screen sessions | |
screen -S myscreen1 # CREATE a new session named *myscreen1* |
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
WP_HOME - where home is | |
homeurl | |
home_url() | |
Site Address (URL) | |
http://example.com | |
WP_SITEURL - where wordpress is (when having wp in a subdirectory home without the subdir path, like at https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory) | |
siteurl | |
site_url() |
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/env python | |
# both python 2 and 3 comatible | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
try: | |
input = raw_input | |
except NameError: | |
pass | |
import sys |
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/env sh | |
sudo apt-get update -y | |
# C compilers and stuff | |
sudo apt-get install -y build-essential | |
# unzip | |
sudo apt-get install -y unzip |
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
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
/usr/bin/ssh-add; | |
} |
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/env bash | |
__powerline() { | |
# Unicode symbols | |
readonly PS_SYMBOL_DARWIN='' | |
readonly PS_SYMBOL_LINUX='$' | |
readonly PS_SYMBOL_OTHER='%' | |
readonly GIT_BRANCH_SYMBOL='⑂ ' | |
readonly GIT_BRANCH_CHANGED_SYMBOL='+' |