Skip to content

Instantly share code, notes, and snippets.

Greg Sadetsky gregsadetsky

Block or report user

Report or block gregsadetsky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dennybritz
dennybritz / tf8_aws.sh
Last active Apr 14, 2017
Tensorflow 0.9 on AWS GPU instance installation
View tf8_aws.sh
# Install build tools
sudo apt-get update
sudo apt-get install -y build-essential git python-pip libfreetype6-dev libxft-dev libncurses-dev libopenblas-dev gfortran python3-matplotlib libblas-dev liblapack-dev libatlas-base-dev python3-dev python3-pydot linux-headers-generic linux-image-extra-virtual unzip python3-numpy swig python3-pandas python-sklearn unzip python3-pip python3-venv
# Install CUDA 7
# wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1410/x86_64/cuda-repo-ubuntu1410_7.0-28_amd64.deb
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1504/x86_64/cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1504_7.5-18_amd64.deb && rm cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda
@RobJDavey
RobJDavey / U1F300.txt
Last active Jan 16, 2018
OS X Emoji (with names from 10.11.4)
View U1F300.txt
Miscellaneous Symbols and Pictographs
🌀️ = [1F300] CYCLONE
🌁️ = [1F301] FOGGY
🌂️ = [1F302] CLOSED UMBRELLA
🌃️ = [1F303] NIGHT WITH STARS
🌄️ = [1F304] SUNRISE OVER MOUNTAINS
🌅️ = [1F305] SUNRISE
🌆️ = [1F306] CITYSCAPE AT DUSK
🌇️ = [1F307] SUNSET OVER BUILDINGS
@diffused
diffused / gist:5517341
Created May 4, 2013
Python peewee orm. How to do a "where in (1,2,3)" style query. It was kind of tricky to find the syntax in the docs/google
View gist:5517341
products = Product.select().where(
Product.id << [161,162,163,164,165]).where(
~(Product.brand_name >> None)
)
@j0hnm4r5
j0hnm4r5 / photonFftExample.ino
Last active Apr 7, 2018
An example for doing FFT analysis on a Particle Photon
View photonFftExample.ino
#include <math.h>
/*
Example application for doing FFT on a Particle Photon and sending the data to Processing on a computer
Designed for Phyiscal Computing Studio, Spring 2016, IDeATe @ Carnegie Mellon University: http://courses.ideate.cmu.edu/physcomp/s16/48-390/
Inspired by Adafruit's FFT: Fun with Fourier Transforms tutorial: https://learn.adafruit.com/fft-fun-with-fourier-transforms/software
FFT function from Paul Bourke: http://paulbourke.net/miscellaneous/dft/
TCP connection code provided by Alex Alspach
@ericremoreynolds
ericremoreynolds / bisect_key.py
Last active Mar 5, 2019
Key-like functionality recipe for Python's bisect functions
View bisect_key.py
class KeyifyList(object):
def __init__(self, inner, key):
self.inner = inner
self.key = key
def __len__(self):
return len(self.inner)
def __getitem__(self, k):
return self.key(self.inner[k])
@gregsadetsky
gregsadetsky / settings.py
Last active Apr 26, 2019
See: http://stackoverflow.com/questions/13705328/ -- I was looking for a way to run Selenium tests for a Django app on a staging server hosted on Heroku using a PostgreSQL database. The DjangoTestSuiteRunner creates and destroys the whole database before/after testing, which would not work on Heroku where databases are added via other means (her…
View settings.py
import dj_database_url
TEST_DATABASES = {
'default': dj_database_url.config(env='TEST_DATABASE_URL')
}
# replace path below to point to HerokuTestSuiteRunner class
TEST_RUNNER = 'python.path.to.test_suite_runner.HerokuTestSuiteRunner'
@sintaxi
sintaxi / regions.txt
Last active May 15, 2019
Surge Regions
View regions.txt
List of regions your project is served from when you deploy using surge.
yyz.surge.sh : 159.203.50.177 : CA : Toronto
jfk.surge.sh : 159.203.159.100 : US : New York
sfo.surge.sh : 138.197.235.123 : US : San Francisco
lhr.surge.sh : 46.101.67.123 : GB : London
ams.surge.sh : 188.166.132.94 : NL : Amsterdam
fra.surge.sh : 138.68.112.220 : DE : Frankfurt
sgp.surge.sh : 139.59.195.30 : SG : Singapore
@JosephRedfern
JosephRedfern / YouTube 8m Video ID scraper.py
Created Sep 28, 2016
Scrapes the youtube video IDs for the youtube-8m data set. Probably buggy. Could be threaded.
View YouTube 8m Video ID scraper.py
import requests
from collections import defaultdict
csv_prefix = "http://www.yt8m.org/csv"
r = requests.get("{0}/verticals.json".format(csv_prefix))
verticals = r.json()
block_urls = defaultdict(list)
count = 0
View setup-headless-selenium-xvfb.sh
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
View ascii-art-browser-console.js
/*
* © 2016 - Julián Acosta
* License: CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0/)
*
* Print your own logo in developer tools!
*
* Step 1: Convert your logo to ASCII text here: http://picascii.com (I used color output)
* Note: Is possible that you'll have to resize your photo in order to retain aspect ratio
* Step 2: Remove the <pre></pre> tag that is surrounding the generated code, replace with "[" and "]"
* Step 3: Run the following regexes (*DON'T ALTER THE ORDER*) in order to convert to JSON (Works in PHPStorm and Sublime Text 2):
You can’t perform that action at this time.