This file contains hidden or 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
"""ajaxgoogle.py - Simple bindings to the AJAX Google Search API | |
(Just the JSON-over-HTTP bit of it, nothing to do with AJAX per se) | |
http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje | |
brendan o'connor - gist.github.com/28405 - anyall.org""" | |
try: | |
import json | |
except ImportError: | |
import simplejson as json | |
import urllib, urllib2 |
This file contains hidden or 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
*.pbxproj -crlf -diff -merge |
This file contains hidden or 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 os | |
import re | |
for file in os.listdir("."): | |
# | |
if os.path.islink(file): | |
realFile = os.path.realpath(file) |
This file contains hidden or 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
public class Singleton { | |
private Singleton INSTANCE; | |
public static Singleton getInstance() { | |
if ( instance == NULL ) { | |
synchronized(Singleton.class) { | |
INSTANCE = new Singleton(); | |
} | |
} |
This file contains hidden or 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
CREATE DATABASE oinc; | |
USE oinc; | |
CREATE TABLE Employee ( | |
ID INT(2) auto_increment primary key, | |
first_name VARCHAR(20), | |
last_name VARCHAR(30), | |
start_date DATE, | |
salary int(6), |
This file contains hidden or 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 noun_type_train_station_start = { | |
name: "Train station", | |
label: "station", | |
default: "Stuttgart Hbf", | |
};*/ | |
var noun_type_train_station = { | |
name: "Train station", | |
label: "station", | |
default: "Stuttgart Hbf", |
This file contains hidden or 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
Options +FollowSymlinks | |
RewriteEngine on | |
# No intersticial for direct reference and self-reference | |
RewriteCond %{HTTP_REFERER} !^$ | |
RewriteCond %{HTTP_REFERER} !^http(s)?://box.leebyron.com/.*$ [NC] | |
# Add a line item for every website you don't need an intersticial for | |
# I've added my own website, gmail and facebook | |
RewriteCond %{HTTP_REFERER} !^http(s)?://([^\.]*.)?leebyron.com/.*$ [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://mail.google.com/.*$ [NC] |
This file contains hidden or 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
# taken from http://www.artima.com/weblogs/viewpost.jsp?thread=4829 | |
import sys | |
import getopt | |
class Usage(Exception): | |
def __init__(self, msg): | |
self.msg = msg | |
def main(argv=None): | |
if argv is None: |
This file contains hidden or 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 MySQLdb | |
conn = MySQLdb.Connect(host="localhost", port=3306, user="mvaz", passwd="whatever", db="trades") | |
cursor = conn.cursor() | |
sql = "select * from Users" | |
cursor.execute(sql) | |
rows = cursor.fetchall() | |
for row in rows: | |
print row |
This file contains hidden or 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
package de.tutorials; | |
import java.util.Date; | |
import java.util.Properties; | |
import javax.mail.Authenticator; | |
import javax.mail.Message; | |
import javax.mail.PasswordAuthentication; | |
import javax.mail.Session; | |
import javax.mail.Transport; |
OlderNewer