Skip to content

Instantly share code, notes, and snippets.

View MaxMorais's full-sized avatar
🏢
Building Solutions in Tech

Maxwell Morais MaxMorais

🏢
Building Solutions in Tech
View GitHub Profile
@gagarine
gagarine / mysql_multiple_import.bash
Created February 24, 2011 22:34
Import multiple sql file in a mysql database
#!/bin/bash
db=$1
user=$2
passwd=$3
if [ "$db" = "" ]; then
echo "Usage: $0 db_name user password"
exit 1
fi
clear
for sql_file in *.sql; do
@jbpotonnier
jbpotonnier / gtranslate.py
Created February 12, 2011 18:56
Translate between french and english using google api
# -*- coding: iso-8859-15 -*-
import Tkinter as tkinter
import urllib2, urllib
import json
TRANSLATE_URL = 'http://ajax.googleapis.com/ajax/services/language/translate'
TO_ENGLISH = 'fr|en'
TO_FRENCH = 'en|fr'
@TheNicholasNick
TheNicholasNick / ishikawa_sha1.js
Created November 25, 2010 01:19
Takanori Ishikawa's JavaScript implementation of the Secure Hash Algorithm 1 (SHA1)
/*
* The JavaScript implementation of the Secure Hash Algorithm 1
*
* Copyright (c) 2008 Takanori Ishikawa <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
@mumrah
mumrah / websocketserver.py
Created August 7, 2010 17:01
Simple WebSockets in Python
import time
import struct
import socket
import hashlib
import sys
from select import select
import re
import logging
from threading import Thread
import signal
import lxml.etree
def pprint(elem):
print lxml.etree.tostring(elem, pretty_print=True)
class Bind(object):
def __init__(self, path, converter=None, first=False):
'''
path -- xpath to select elements
converter -- run result through converter
first -- return only first element instead of a list of elements