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 sys | |
import struct | |
import select | |
def parse_scanner_data(scanner_data): | |
upc_chars = [] | |
for i in range(0, len(scanner_data), 16): | |
chunk = scanner_data[i:i+16] | |
# __ __ __ __ __ __ __ __ 01 00 __ 00 00 00 00 00 |
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/python | |
import csv | |
import cooperhewitt.api.client | |
access_token = 'API_KEY' | |
hostname = 'api.collection.cooperhewitt.org' | |
if __name__ == "__main__": |
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
function success(position) { | |
var s = document.querySelector('#status'); | |
s.innerHTML = "found you at " + position.coords.latitude + " " + position.coords.longitude; | |
} | |
function error(msg) { | |
var s = document.querySelector('#status'); | |
s.innerHTML = typeof msg == 'string' ? msg : "failed"; | |
} |
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 mongoose = require('mongoose'), | |
Schema = mongoose.Schema; | |
// simple schema for Mongo | |
var MessageSchema = new Schema({ | |
archived: { | |
type: Date, | |
default: Date.now | |
}, | |
message_id: { |
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
;; fix for php-mode | |
(require 'cl) | |
;; package manager stuff | |
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") | |
("marmalade" . "http://marmalade-repo.org/packages/") | |
("melpa" . "http://melpa.milkbox.net/packages/"))) | |
(setq package-enable-at-startup nil) | |
(package-initialize) |
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/sh | |
# Check out the code on this server. | |
GIT_WORK_TREE=/home/git/working/<username>/<projectname> git checkout -f | |
# Define an array of servers to which the code will be deployed. | |
SERVERS="abc.example.com, xyz.example.com" | |
# Push codebase to the servers via rsync. | |
for SERVER in $SERVERS |
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 python | |
# Clone or update all a user's gists | |
# curl -ks https://raw.github.com/gist/5466075/gist-backup.py | USER=fedir python | |
# USER=fedir python gist-backup.py | |
import json | |
import urllib | |
from subprocess import call | |
from urllib import urlopen | |
import os |
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 | |
DATESTRING="$(date -I)" | |
DATADIR="data/" | |
DATAFILE="${DATESTRING}_objects.csv" | |
DUMPFILE="${DATADIR}${DATESTRING}_objects.csv" | |
AWS_ACCESS_KEY="$(cat aws_access_key)" | |
AWS_SECRET_ACCESS_KEY="$(cat aws_secret_access_key)" | |
export PGPASSWORD="$(cat redshift_pass)" |
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 | |
set -o errexit | |
# Author: David Underhill | |
# Script to permanently delete files/folders from your git repository. To use | |
# it, cd to your repository's root and then run the script with a list of paths | |
# you want to delete, e.g., git-delete-history path1 path2 | |
if [ $# -eq 0 ]; then | |
exit 0are still |
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
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
OlderNewer