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
<?php | |
require('keyboardLogin.php'); | |
// show all errors | |
ini_set('display_errors', true); | |
ini_set('display_startup_errors', true); | |
error_reporting( E_ALL ); | |
dbConnect(); | |
$query = "SELECT * from keyboard.keys" |
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
<?php | |
$key_char = ''; | |
$row = ''; | |
$col = ''; | |
$type = ''; | |
$name = ''; | |
$slug = ''; | |
$text = ''; | |
if( isset($_GET['key_char']) ) $key_char = $_GET['key_char']; |
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
<?php | |
$key_char = ''; | |
$row = ''; | |
$col = ''; | |
$type = ''; | |
$name = ''; | |
$slug = ''; | |
$text = ''; | |
if( isset($_GET['key_char']) ) $key_char = $_GET['key_char']; |
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
Bitly tech talk 4/22/2010 | |
On 4/22 we held a bit.ly tech talk on 'Command Line Fu', where we invited talented hackers to come share their best moves. Please correct my notes and add your fu here! | |
# @jehiah | |
# in place file regex replacement | |
perl -pi -e 's/this/that/g' filename_pattern | |
# print the last column of a file ($NF stands for 'Number of Fields' or more commonly Last Field). |
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 urllib2 | |
import time | |
from BeautifulSoup import BeautifulSoup | |
f = open('/Users/lehrblogger/Desktop/flor.csv') | |
soup = BeautifulSoup(urllib2.urlopen('http://www.flor.com/get-samples.html?limit=all')) | |
for a in soup.findAll('a', 'samples-link'): | |
try: | |
href = 'http://www.flor.com' + a['href'] |
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 sbt._ | |
class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) { | |
val liftVersion = "2.3" | |
val rogue = "com.foursquare" %% "rogue" % "1.0.9" withSources() | |
// uncomment the following if you want to use the snapshot repo | |
// val scalatoolsSnapshot = ScalaToolsSnapshots |
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
function (key, values, rereduce) { | |
// value -> [count, min, max, mean] | |
var i = 0 | |
, l = values.length | |
, min = values[i][2] // set min to the first max | |
, max = 0 | |
, weighted_sum_of_means = 0 | |
, count = 0 | |
, cur_count // just for clarity, feel free to remove later | |
, cur_min |
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
logdir="/Users/lehrblogger/Dropbox/sync/Adium 2.0/Users/Default/Logs" | |
buddy=$1 | |
search=$2 | |
find "$logdir"/*/"$buddy" -type f -name \*.xml -exec grep -il $search {} \; |
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
root@lucid32:/vagrant/code/SleekXMPP# python /vagrant/code/SleekXMPP/examples/register_account.py -v -j 'admin1@localhost' -p 'test_password' -u 'new_username' | |
DEBUG setting jid to admin1@localhost | |
DEBUG Loaded Plugin: RFC 6120: Stream Feature: STARTTLS | |
DEBUG Loaded Plugin: RFC 6120: Stream Feature: Resource Binding | |
DEBUG Loaded Plugin: RFC 3920: Stream Feature: Start Session | |
DEBUG Loaded Plugin: RFC 6120: Stream Feature: SASL | |
DEBUG Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning | |
DEBUG Loaded Plugin: XEP-0030: Service Discovery | |
DEBUG Loaded Plugin: XEP-0004: Data Forms | |
DEBUG Loaded Plugin: XEP-0066: Out of Band Data |
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
~/Desktop/vagrant_1/code/ejabberd/src 176$ diff ejabberd.cfg ejabberd.cfg.example | |
368c368 | |
< {acl, admin, {user, "admin1", "localhost"}}. | |
--- | |
> %%{acl, admin, {user, "aleksey", "localhost"}}. | |
391,395d390 | |
< %% Unauthenticated users | |
< %% | |
< {acl, unauthenticated, {user, "", ""}}. | |
< |
OlderNewer