Skip to content

Instantly share code, notes, and snippets.

Avatar

Lance R. Vick lrvick

View GitHub Profile
View git.diff.txt
reverted:
--- b/aliases
+++ a/aliases
@@ -1,2 +1,3 @@
# See man 5 aliases for format
postmaster: root
+root: root@hashbang.sh
reverted:
--- b/apparmor.d/abstractions/tor
+++ a/apparmor.d/abstractions/tor
@lrvick
lrvick / jQuery.EmbedPicasaGallery.js
Created Jan 3, 2012 — forked from mwolfetech/jQuery.EmbedPicasaGallery.js
Adjustment to EmbedPicasaGallery to pass album description, photo count, and title back to user provided callback functions.
View jQuery.EmbedPicasaGallery.js
/**************************************************************************
* Name: EmbedPicasaGallery
* Author: Tobias Oetiker <tobi@oetiker.ch>
* Demo: http://tobi.oetiker.ch/photo/
* $Id: jquery.EmbedPicasaGallery.js 474 2011-06-16 09:02:45Z oetiker $
**************************************************************************
Description:
[elided]
@lrvick
lrvick / manual_nltk_bayes_classify.py
Created Oct 6, 2011 — forked from tsoporan/manual_nltk_bayes_classify.py
Manually train an NLTK NaiveBayes Classifier
View manual_nltk_bayes_classify.py
from nltk.probability import ELEProbDist, FreqDist
from nltk import NaiveBayesClassifier
from collections import defaultdict
train_samples = {
'I hate you and you are a bad person': 'neg',
'I love you and you are a good person': 'pos',
'I fail at everything and I want to kill people' : 'neg',
'I win at everything and I want to love people' : 'pos',
'sad are things are heppening. fml' : 'neg',
@lrvick
lrvick / manual_nltk_bayes_classify.py
Created Oct 6, 2011 — forked from tsoporan/manual_nltk_bayes_classify.py
Manually train an NLTK NaiveBayes Classifier
View manual_nltk_bayes_classify.py
from nltk.probability import DictionaryProbDist
from nltk import NaiveBayesClassifier
from nltk import FreqDist
train_samples = {
'I hate you and you are a bad person': 'neg',
'I love you and you are a good person': 'pos',
'I fail at everything and I want to kill people' : 'neg',
'I win at everything and I want to love people' : 'pos',
'sad are things are heppening. fml' : 'neg',
View redis_pubsub_demo.rb
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@lrvick
lrvick / results.py
Created Jun 23, 2011 — forked from tsoporan/results.py
Get async celery results from nested subtasks as they complete
View results.py
from tasks import task1
def get_results(queries):
query_procs = task1.delay(queries).get()
tasks = []
for query_proc in query_procs:
tasks.extend(query_proc.subtasks)
while tasks:
current_task = tasks.pop(0)
@lrvick
lrvick / results.py
Created Jun 22, 2011 — forked from ask/get_results.py
Get async celery results from nested subtasks as they complete
View results.py
from tasks import task1
def get_results(queries):
query_procs = task1.delay(queries).get().join()
results = []
for query_proc in query_procs:
# while the following iterate() is happening, the other query_procs are ignored.
# ideas on iterating over all of them at once?
for result in query_proc.iterate():
yield result
@lrvick
lrvick / notification.confirm.md
Created May 4, 2011 — forked from mwbrooks/notification.confirm.md
Markdown code block within list item
View notification.confirm.md

foo

  1. index is the 0 based index value of the button pressed

  2. label is the text label of the button pressed

         function showConfirm() {
             var confirmDelegate = navigator.notification.confirm(
                 'You are the winner!',  // message
                 'Game Over',            // title
    
View twitter_sentiment.py
USER = "your_twitter_user"
PASS = "your_twitter_pass"
if "your_twitter" in USER+PASS:
print "You didn't set your twitter username and password in the script!"
USER = raw_input("Username>")
PASS = raw_input("Password>")
import urllib2, json, base64, sys, os
You can’t perform that action at this time.