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
create table referendum | |
( | |
id INTEGER not null | |
constraint referendum_pk | |
primary key autoincrement, | |
name text | |
); | |
create table questions | |
( |
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
{ 16:07:21 | |
data: { | |
story: { | |
name: 'sales', | |
created_at: '2019-08-02T07:22:25.416Z', | |
published_at: '2019-08-14T08:32:10.635Z', | |
alternates: [], | |
id: 1800973, | |
uuid: '22cf19a8-1f48-4c24-bd22-28a2e8d44243', | |
content: [Object], |
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
upstream {{APP_NAME}} { | |
server unix:/home/{{APP_NAME}}/app/shared/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name example.com; | |
root /home/{{APP_NAME}}/app/current/public; | |
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
apt-get update && apt-get upgrade && apt-get autoremove | |
apt-get install git nodejs nginx ufw python3 python3-pip curl | |
pip3 install jinja2-cli | |
ufw allow 22 && ufw logging off && ufw enable && ufw status | |
npm install yarn | |
apt-get install rng-tools # Apparently: https://stackoverflow.com/questions/37501596/random-nonblocking-pool-initialization-taking-a-long-time-on-ubuntu-16-04-ser | |
# USER | |
echo "Enter your app name (note: this will double as your default username)" | |
read APP_NAME |
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
{"lastUpload":"2018-10-03T16:20:18.770Z","extensionVersion":"v3.1.2"} |
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
mail_address = '' | |
password = '' | |
from selenium import webdriver | |
UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0' | |
PHANTOMJS_ARG = {'phantomjs.page.settings.userAgent': UA} | |
driver = webdriver.PhantomJS(desired_capabilities=PHANTOMJS_ARG) | |
url = 'https://www.google.com/accounts/Login?hl=ja&continue=http://www.google.co.jp/' |
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
""" | |
Example of making a request to JIRA as a trusted application. | |
In this example, we create a new issue as an arbitrary user. | |
More information on this technique at: | |
https://answers.atlassian.com/questions/247528/how-do-you-impersonate-a-user-with-jira-oauth | |
""" | |
import oauth2 | |
import time |
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
import os | |
from subprocess import check_call | |
def post_save(model, os_path, contents_manager): | |
"""post-save hook for converting notebooks to .py and .html files.""" | |
if model['type'] != 'notebook': | |
return # only do this for notebooks | |
d, fname = os.path.split(os_path) | |
check_call(['ipython', 'nbconvert', '--to', 'script', fname], cwd=d) | |
check_call(['ipython', 'nbconvert', '--to', 'html', fname], cwd=d) |
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
#Tested on Ubuntu/trusty64 | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install libgl1-mesa-dev:i386 | |
sudo apt-get install openjdk-7-jdk | |
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz ~/ | |
tar zxvf ~/android-sdk-linux |
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 bash | |
# Initialize a new OS with my preferred defaults | |
command_exists() { | |
type "$1" &> /dev/null ; | |
} | |
# Anything we download can be dropped and installed from here without fear | |
cd /tmp |
NewerOlder