Skip to content

Instantly share code, notes, and snippets.

View allenhurff's full-sized avatar

Allen Hurff allenhurff

View GitHub Profile
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import numpy
import colorsys
from PIL import Image, ImageDraw, ImageFont, ImageFilter
from fonts.ttf import RobotoMedium as UserFont
@sirneb
sirneb / docker-compose.yml
Created September 18, 2018 05:22
Tezos mainnet docker compose
version: "2"
services:
node:
image: tezos/tezos:mainnet
hostname: node
command: tezos-node
ports:
- "8732:8732"
- "9732:9732"
#!/bin/bash
# To install:
# add to ~/Scripts/
# add "alias brewup='~/Scripts/brewup.sh'" to ~/.bash_profile
brew update -a; brew upgrade -a; brew prune; brew cleanup; brew cu -a -y; brew cask cleanup; brew doctor;
@vickyqian
vickyqian / twitter crawler.txt
Last active May 11, 2024 16:19
A Python script to download all the tweets of a hashtag into a csv
import tweepy
import csv
import pandas as pd
####input your credentials here
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@allenhurff
allenhurff / ghost.conf
Created September 3, 2014 09:47
Ghost Upstart Script (lives in /etc/init.d/)
# ghost
# description "An Upstart task to make sure that my Ghost server is always running"
# author "@allenhurff"
start on startup
script
cd /var/www/ghost/
npm start --production
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active November 27, 2024 13:36
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@allenhurff
allenhurff / gist:5087147
Created March 5, 2013 00:58
Sublime Text 3 - Useful Shortcuts Source Gist: https://gist.github.com/nuxlli/1207014
# Sublime Text 3 - Useful Shortcuts
*Tested in Mac OS X: super == command*
Open/Goto
_________
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
- super+shift+p: command prompt
@masnick
masnick / gist:1654182
Created January 21, 2012 21:52
Amazon S3 bucket policy for www.maxmasnick.com
{
"Version": "2008-10-17",
"Id": "b2cc31d0-cc91-4285-a658-473099d2c867",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods