Skip to content

Instantly share code, notes, and snippets.

create table referendum
(
id INTEGER not null
constraint referendum_pk
primary key autoincrement,
name text
);
create table questions
(
{ 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],
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;
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
@aaronmyatt
aaronmyatt / cloudSettings
Last active October 3, 2018 16:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-03T16:20:18.770Z","extensionVersion":"v3.1.2"}
@aaronmyatt
aaronmyatt / google_login.py
Last active October 27, 2017 08:20 — forked from ikegami-yukino/google_login.py
Automatically Google login by selenium
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/'
@aaronmyatt
aaronmyatt / gist:3184c1e2d911224d050ec95fe24dd51c
Created October 27, 2017 05:56 — forked from lukecyca/gist:907c4a62758c068fd464
Impersonating a user with the JIRA API
"""
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
@aaronmyatt
aaronmyatt / post-save-hook.py
Created October 6, 2016 14:24 — forked from jbwhit/post-save-hook.py
Saves Jupyter Notebooks as .py and .html files automatically. Add to the ipython_notebook_config.py file of your associated profile.
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)
#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
@aaronmyatt
aaronmyatt / nix_setup.sh
Created February 17, 2016 08:33
Fleshing out some (personally) desirable dev machine setup
#!/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