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
#ifndef LINKEDLIST_H | |
#define LINKEDLIST_H | |
#include <iostream> | |
template <class T> | |
class linkedList { | |
struct node { | |
node* ptr; | |
T data; |
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 flask import Flask | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask.ext.wtf import Form | |
from flask.ext.babel import gettext | |
from wtforms import SelectField, TelField, TextField, FormField, Fieldlist, SubmitField | |
from wtforms.validators import Optional, Required | |
app = Flask(__name__) | |
db = SQLAlchemy(app) |
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 sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Integer, Column | |
from postgresql_json import JSON | |
Base = declarative_base() | |
class Document(Base): | |
id = Column(Integer(), primary_key=True) | |
data = Column(JSON) | |
#do whatever other work |
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/bash | |
PERCENTAGE=0 | |
( | |
while [ $PERCENTAGE -le 100 ]; do | |
echo "$PERCENTAGE" | |
case $PERCENTAGE in | |
[1-9]) | |
;; |
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
import csv | |
from StringIO import StringIO | |
def rec_getattr(obj, attr, default=None): | |
"""Get object's attribute. May use dot notation. | |
>>> class C(object): pass | |
>>> a = C() | |
>>> a.b = C() | |
>>> a.b.c = 4 |
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
import requests | |
import subprocess | |
f = open("dolphin-list.txt", "r") | |
ALL_FILES = [l.strip() for l in f.readlines()] | |
SOURCE_URL = "https://dl.dolphin-emu.org/builds/" | |
len(ALL_FILES) |
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
echo Setting OSX values for Virtual Box ${1} | |
VBoxManage modifyvm "${1}" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff | |
VBoxManage setextradata "${1}" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3" | |
VBoxManage setextradata "${1}" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" | |
VBoxManage setextradata "${1}" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" | |
VBoxManage setextradata "${1}" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" | |
VBoxManage setextradata "${1}" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 |
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
[02/17/15 23:44:56] [INFO] Reading configuration file /home/frank/.ngrok | |
[02/17/15 23:44:56] [INFO] [client] Trusting root CAs: [assets/client/tls/ngrokroot.crt] | |
[02/17/15 23:44:56] [INFO] [view] [web] Serving web interface on 0.0.0.0:8888 | |
[02/17/15 23:44:56] [INFO] Checking for update | |
[02/17/15 23:44:56] [DEBG] [ctl:374737d0] New connection to: 96.126.125.171:443 | |
[02/17/15 23:44:56] [DEBG] [ctl:374737d0] Writing message: {"Type":"Auth","Payload":{"Version":"2","MmVersion":"1.7","User":"ZnDxl31mzAgxJhgAb7Tc","Password":"","OS":"linux","Arch":"amd64","ClientId":""}} | |
[02/17/15 23:44:56] [DEBG] [ctl:374737d0] Waiting to read message | |
[02/17/15 23:44:57] [DEBG] [ctl:374737d0] Reading message with length: 120 | |
[02/17/15 23:44:57] [DEBG] [ctl:374737d0] Read message {"Type":"AuthResp","Payload":{"Version":"2","MmVersion":"1.7","ClientId":"03f700f2df0a3bc9f2bc5e74606ea8b6","Error":""}} | |
[02/17/15 23:44:57] [INFO] [client] Authenticated with server, client id: 03f700f2df0a3bc9f2bc5e74606ea8b6 |
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 python2 | |
import boto | |
from collections import defaultdict | |
from pprint import pprint | |
import os, sys | |
DIVIDER = """ | |
=========================================== | |
======== ec2-instances ======== |
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
var async = require("async"); | |
var AWS = require("aws-sdk"); | |
var gm = require("gm").subClass({imageMagick: true}); | |
var fs = require("fs"); | |
var mktemp = require("mktemp"); | |
var THUMB_KEY_PREFIX = "thumbnails/", | |
THUMB_WIDTH = 150, | |
THUMB_HEIGHT = 150, | |
ALLOWED_FILETYPES = ['png', 'jpg', 'jpeg', 'bmp', 'tiff', 'pdf', 'gif']; |
OlderNewer