Skip to content

Instantly share code, notes, and snippets.

@dennybritz
dennybritz / tf8_aws.sh
Last active April 14, 2017 14:19
Tensorflow 0.9 on AWS GPU instance installation
# 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 January 16, 2018 22:44
OS X Emoji (with names from 10.11.4)
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
@akuzemchak
akuzemchak / Side Bar.sublime-menu
Created August 13, 2011 15:35
Reveal folder in Finder for Sublime Text 2
# add this to the main command array...
{ "caption": "Open Containing Folder…", "command": "open_this_folder", "args": {"dirs": []} }
@diffused
diffused / gist:5517341
Created May 4, 2013 12:24
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
products = Product.select().where(
Product.id << [161,162,163,164,165]).where(
~(Product.brand_name >> None)
)
@CoreyRab
CoreyRab / customAtrributes.swift
Last active April 28, 2020 01:43
Save custom attributes in RevenueCaat
// 2.
Purchases.shared.setAttributes(["favorite_workout" : "cycling"])
@billti
billti / favicon.js
Last active August 12, 2020 21:23
Create inline GIF favicons
/* Bill Ticehurst, 2020
Emits a minimal 16 x 16 gif suitable for use as an inline favicon
GIF spec at https://www.w3.org/Graphics/GIF/spec-gif89a.txt for the structure
Favicon formats supported at https://en.wikipedia.org/wiki/Favicon
For a transparent GIF (color_table = false, depend_on_background = true) this emits:
<link rel="icon" href="data:image/gif;base64,R0lGODlhEAAQAAAAACwAAAAAAQABAAACASgAOw==">
@j0hnm4r5
j0hnm4r5 / photonFftExample.ino
Last active February 18, 2021 22:48
An example for doing FFT analysis on a Particle Photon
#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
@lonetwin
lonetwin / print_table.py
Last active May 7, 2021 15:42
print out ascii tables in python using data in the form: [ ('column 0 title', 'column 1 title' ..), ('row 0, column 0 data', 'row 0, column 1 data' ...) ...]
# I needed to print out ascii tables from data in the form:
# [ ('column 0 title', 'column 1 title' ..),
# ('row 0, column 0 data', 'row 0, column 1 data' ...) ...]
#
# and surprisingly it got complicated because of variable lengths of the data.
# I googled for 'standard' ways of doing this and I found suggestions like:
# http://stackoverflow.com/questions/5909873/python-pretty-printing-ascii-tables
# ...which were a bit dated and hard to read or full scale modules like:
#
# http://pypi.python.org/pypi/texttable/
@gregsadetsky
gregsadetsky / settings.py
Last active May 28, 2021 18:37
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…
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'
@ouelletv
ouelletv / socialSharePopups.js
Created August 1, 2018 13:58 — forked from josephabrahams/socialSharePopups.js
Facebook & Twitter Share Popup Windows
export default function() {
document.querySelectorAll('.js-share-facebook-link').forEach(function(el){
el.addEventListener('click', function(e){
var href = e.target.href;
e.preventDefault();
window.open(href, "Facebook", "toolbar=no,location=0,status=no,menubar=no,scrollbars=yes,width=600,height=400,resizable=1");
})
});