Skip to content

Instantly share code, notes, and snippets.

View adelevie's full-sized avatar

Alan deLevie adelevie

View GitHub Profile
@ericnkatz
ericnkatz / Default (OSX).sublime-keymap
Created February 7, 2014 22:19
Github Gist Sublime Keymap
[
{ "keys": ["super+k", "super+i"], "command": "gist" },
{ "keys": ["super+k", "super+p"], "command": "gist_private" },
{ "keys": ["super+k", "super+s"], "command": "gist_update_file" },
{ "keys": ["super+k", "super+o"], "command": "gist_list" },
{ "keys": ["super+k", "super+["], "command": "insert_gist_list" },
{ "keys": ["super+k", "super+]"], "command": "gist_add_file" }
]
@zpao
zpao / app.js
Created March 30, 2014 02:19
express-react-views. All server generated, no client mount or anything.
// normal express stuff
app.set('view engine', 'jsx');
app.engine('jsx', require('express-react-views').__express);
// the rest of it
@benbalter
benbalter / example-output.md
Last active August 29, 2015 14:16
Ruby script to check if the status of an export license application (STELA request) has changed and output the result
Status: UNCHANGED
+-------------------+--------------------------+
|             Application XXXX                 |
+-------------------+--------------------------+
| Application Type  | Commodity Classification |
| Review Status     | Completed                |
| Registration Date | 01/01/2015               |
| Completion Date   | 01/02/2015               |
| Final Decision | |
#!/usr/bin/env ruby
require 'rubygems'
require 'roo'
pwd = File.dirname(__FILE__)
Dir.glob("#{pwd}/*.xls") do |file|
file_path = "#{pwd}/#{file}"
file_basename = File.basename(file, ".xls")
xls = Excel.new(file_path)
@gbinal
gbinal / gist:3514850
Created August 29, 2012 16:01
First Round Goals for .gov github mashups
Needs: Should not require any code libraries from the host website but rather should be simple html while still static. [Note the iframe model used at http://www.nasa.gov/digitalstrategy/ via http://goo.gl/bzHH2 (code- http://goo.gl/StAvQ)]
Goals:
1. Widget for most recent commits from one github org (note - https://github.com/presidential-innovation-fellows/mygov/blob/gh-pages/_includes/js/commits.js )
2. Widget for most recent commits from all registered .gov github orgs, pulled dynamically from the SMR api
3. Widget for most active repos from one github org
4. Widget for most active repos from all registered .gov github orgs, pulled dynamically from the SMR api
5. Widget for most recent public activity from one github org
@pcolton
pcolton / gist:4410841
Last active December 10, 2015 08:58
Sample of monitoring CSS file changes with Pixate and RubyMotion. #pixate #rubymotion
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
PixateFreestyle.initializePixateFreestyle
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = UIViewController.alloc.init
@window.styleMode = PXStylingNormal
@button = UIButton.buttonWithType UIButtonTypeSystem
@hopsoft
hopsoft / distributed_object.rb
Last active December 20, 2015 12:39
Helpers for making DRb a bit simpler for common tasks that benefit from concurrent processing.
require "drb"
require "monitor"
require "socket"
module Shared
class DistributedObject
include MonitorMixin
attr_reader :pid, :uri
@baojie
baojie / naivebayes.py
Created July 16, 2013 21:58
NLTK based naive bayes classifier
# Jie Bao, 2013-07-16
# baojie@gmail.com
# simple Naive Bayes classifier
import nltk
from nltk.corpus import movie_reviews
import random
import os
import json
@flavio
flavio / gemfile_lock2geminabox.rb
Created February 2, 2012 09:21
Parse Gemfile.lock, download all gems from rubygems and then upload them to a local instance of geminabox
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
require 'fileutils'
require 'net/http'
require 'net/https'
require 'uri'
TMP_DIR = "/tmp/gems"