Estimated time: 10 minutes
This file contains hidden or 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 collections import defaultdict | |
import numpy | |
from timeit import timeit | |
DATA = {"value": 1} | |
def square_bracket(): | |
assert DATA["value"] is not None |
This file contains hidden or 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 praw import Reddit | |
# Get a Reddit instance | |
# https://praw.readthedocs.io/en/latest/code_overview/reddit_instance.html# | |
reddit = Reddit( | |
client_id="<client_id>", | |
client_secret="<client_secret>", | |
username="<user>", | |
password="<password>", |
This file contains hidden or 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
openssl genrsa -out server.key 2048 | |
openssl req -key server.key -sha256 -x509 -nodes -new -days 3650 -out server.crt -subj "/CN=Local Development" \ | |
-reqexts SAN -extensions SAN \ | |
-config <(cat /usr/local/etc/[email protected]/openssl.cnf \ | |
<(printf '[SAN]\nsubjectAltName=DNS:dev.local')) | |
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain server.crt | |
sudo nginx -s stop && sudo nginx |
This file contains hidden or 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 node | |
const proc = require('child_process'); | |
const crypto = require('crypto'); | |
const config = require('./config'); | |
connect() | |
function connect() { | |
var step = 0; |
This file contains hidden or 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
Set-ExecutionPolicy Bypass | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux | |
lxrun /install /y | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco install googlechrome slack -y | |
choco install visualstudiocode phpstorm -y | |
choco install sqlnotebook -y |
This file contains hidden or 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 apt install -y autoconf automake build-essential python-dev libtool libssl-dev pkg-config | |
cd /tmp | |
git clone https://github.com/facebook/watchman.git -b v4.9.0 --depth 1 | |
cd watchman/ | |
./autogen.sh | |
./configure --enable-lenient | |
make | |
sudo make install |
This file contains hidden or 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 node | |
const clear = '\033c'; | |
(function() { | |
"use strict"; | |
const https = require('https'), | |
config = require('./config'), | |
// array of usernames to filter | |
people = config.people, | |
// server for your bit bucket server |
This file contains hidden or 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
/* Go to https://www.facebook.com/pokes/ and run the following */ | |
setInterval(() => { | |
for (let node of document.getElementsByTagName('a')) { | |
if (node.textContent === "Poke Back") { | |
node.click(); | |
} | |
} | |
}, 100) |
This file contains hidden or 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 | |
import httplib, json | |
try: | |
from configparser import ConfigParser | |
except ImportError: | |
from ConfigParser import ConfigParser # ver. < 3.0 | |
# config and globals | |
tweetMessages = [] |
NewerOlder