Skip to content

Instantly share code, notes, and snippets.

View funkatron's full-sized avatar

Ed Finkler funkatron

View GitHub Profile
phpinfo();
function hrefs2links(text) {
// Uses Grubers regex with some extra camptures
var urire = /\b(?:[a-z][\w\-]+:(?:\/{1,3}|[a-z0-9%])|(www\d{0,3}[.]))((?:[^\s()<>]+|\([^\s()<>]+\))+(?:\([^\s()<>]+\)|[^`!()\[\]{};:'".,<>?«»“”‘’\s]))/g;
// replace URIs with HTML anchors
return text.replace(urire, '<a href="$&">$1$2</a>');
}
var text = hrefs2links("Check out http://example.com");
<?php
$that = $this;
$this->stool->find(function($obj) use ($that) {
if ($obj->source === 'web') {
$that->webSourceCount++;
}
});
?>
var msg = "(I did one for my site; see the logo:https://www.deadspin.com/5227676/stafford-welcomed-to-detroit-with-warm-prickly-arms)";
function linkURLs(str) {
var regexp_url = /([^\w])((http(s?):\/\/)|(www\.))(\w+[^\s\)<]+)/gi;
while ((ms = regexp_url.exec(str))) {
if ( /\.$/.test(ms[6]) ) {
period = '.';
ms[6] = ms[6].slice(0, -1);
#if /dev/tty is missing, run this
sudo mknod /dev/tty c 5 0
sudo chmod 0666 /dev/tty
var ws_re = "[\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029]";
you'll need:
sudo apt-get install gnupg libgpgme11 libgpgme11-dev php5-dev php-pear
sudo pecl install gnupg
/*
constructor for Robot
*/
var Robot = function(name) {
this.name = name;
};
/*
property in prototye
*/
coj@revolverocelot ~ > curl -u myusername http://api.twitter.com/1/account/rate_limit_status.json?source=twitterandroid
Enter host password for user 'myusername':
{"hourly_limit":20000,"reset_time_in_seconds":1284388122,"reset_time":"Mon Sep 13 14:28:42 +0000 2010","remaining_hits":19994}
Mon Sep 13 09:29:07 EDT 2010
coj@revolverocelot ~ > curl -u myusername http://api.twitter.com/1/account/rate_limit_status.json?
Enter host password for user 'myusername':
{"remaining_hits":0,"hourly_limit":0,"reset_time":"Mon Sep 13 14:28:42 +0000 2010","reset_time_in_seconds":1284388122}
/* Edit this file to add your own functionality to Spaz */
/**
* Add some custom timeline filters
*
* There are five timeline filter objects:
* - Spaz.TimelineFilters.friends
* - Spaz.TimelineFilters['public']
* - Spaz.TimelineFilters.lists
* - Spaz.TimelineFilters.search