Skip to content

Instantly share code, notes, and snippets.

View adelevie's full-sized avatar

Alan deLevie adelevie

View GitHub Profile
@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 | |
@jaredLunde
jaredLunde / fix_unicode.py
Created August 15, 2014 16:51
Fix unicode mistakes in python 3
"""
"Fixing common Unicode mistakes with Python — after they’ve been made"
Adapted for use in Python 3.x from:
http://blog.luminoso.com/2012/08/20/fix-unicode-mistakes-with-python/
"""
def fix_bad_unicode(text):
u"""
@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
@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" }
]
@kenrett
kenrett / Selenium Cheat Sheet.md
Last active July 31, 2024 20:56
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
@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
# [email protected]
# simple Naive Bayes classifier
import nltk
from nltk.corpus import movie_reviews
import random
import os
import json
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active February 23, 2023 15:03
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@larsmans
larsmans / kmeans.py
Created February 14, 2013 13:38
k-means clustering in pure Python
#!/usr/bin/python
#
# K-means clustering using Lloyd's algorithm in pure Python.
# Written by Lars Buitinck. This code is in the public domain.
#
# The main program runs the clustering algorithm on a bunch of text documents
# specified as command-line arguments. These documents are first converted to
# sparse vectors, represented as lists of (index, value) pairs.
from collections import defaultdict