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
# 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 |
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
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', |
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
#include <Wire.h> | |
#include <LiquidCrystal.h> | |
#include <SPI.h> | |
#include <Ethernet.h> | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE }; | |
EthernetServer server(80); | |
LiquidCrystal lcd(0); |
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
<?php | |
$mime_type = "image/png" ; // mime type of file to pretend to be | |
$compression = "95" ; // compression | |
$trimming = "yes" ; // trim canvas after rendering, yes or no | |
$canvas_height = "800" ; // height of entire canvas | |
$canvas_width = "800" ; // width of entire canvas | |
$shadow_color = "black" ; // color of drop shadow | |
$size[0] = "140" ; // size in pixils for top image | |
$size[1] = "120" ; // size in pixils for middle image | |
$size[2] = "100`" ; // size in pixils for bottom image |
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
/************************************************************************** | |
* 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] |
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 | |
for NPA in {201..989}; do | |
NXXX=2000 | |
while [ ${NXXX} -lt 9999 ]; do | |
NXXX1=$[$NXXX+1] | |
NXXX2=$[$NXXX+2] | |
NXXX3=$[$NXXX+3] | |
echo "Checking ${NPA}${NXXX}XXX, ${NPA}${NXXX1}XXX, | |
${NPA}${NXXX2}XXX, ${NPA}${NXXX3}XXX..." | |
URL="http://www.whitepages.com/carrier_lookup?carrier=alltel&name;_0=&number;_0=${NPA}${NXXX}000&name;_1=&number;_1=${NPA}${NXXX1}000&name;_2=&number;_2=${NPA}${NXXX2}000&name;_3=&number;_3=${NPA}${NXXX3}000&localtime;=survey" |
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
from scrapy.http import Request | |
from scrapy.spider import BaseSpider | |
from scrapy.selector import HtmlXPathSelector | |
class HackernewsSpider(BaseSpider): | |
name = 'hackernews' | |
allowed_domains = [] | |
start_urls = ['http://news.ycombinator.com'] | |
def parse(self, response): | |
if 'news.ycombinator.com' in response.url: |
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 eventlet | |
from eventlet.green import urllib2 | |
def request(): | |
urllib2.urlopen("http://yourtarget.com").read() | |
print "%s request sent" | |
pool = eventlet.GreenPool(size=1000) | |
while True: |
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
from flask import Flask, request, redirect, url_for | |
from rauth.service import OAuth1Service, OAuth2Service | |
github = OAuth2Service( | |
name='github', | |
consumer_key='GITHUB_CONSUMER_KEY', | |
consumer_secret='GITHUB_CONSUMER_SECRET', | |
access_token_url='https://github.com/login/oauth/access_token', | |
authorize_url='https://github.com/login/oauth/authorize', | |
) |
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
from hd44780 import HD44780 | |
from os import stat | |
from time import sleep | |
lcd = HD44780() | |
lcd.message(" Quake3 Logger\nCommence killing...") | |
logfile_name = 'game.log' |