Skip to content

Instantly share code, notes, and snippets.

<?php
if (isset($_GET['errors'])) { error_reporting(E_ALL); } else { error_reporting(0); }
// Requires the Universal Feed Writer from http://www.phpclasses.org/browse/package/4427.html
include("FeedWriter.php");
define('FIREWALLED', true);
define('FIREWALL_ROOT', 'firewall/');
include(FIREWALL_ROOT.'config/db.php');
@BenWard
BenWard / faves.php
Created August 17, 2009 20:54 — forked from blowery/faves.php
<?php
if (isset($_GET['errors'])) { error_reporting(E_ALL); } else { error_reporting(0); }
// Requires the Universal Feed Writer from http://www.phpclasses.org/browse/package/4427.html
include("FeedWriter.php");
define('FIREWALLED', true);
define('FIREWALL_ROOT', 'firewall/');
include(FIREWALL_ROOT.'config/db.php');
Evernote - e
http://s.evernote.com/grclip?url=%u&title=%t
Pinboard - p
http://pinboard.in/add?url=%u&title=%t
Pinboard read later - l
http://pinboard.in/add?url=%u&title=%t&later=yes&noui=yes&jump=close
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@bradmontgomery
bradmontgomery / kill_attrs.py
Created November 11, 2010 23:12
A way to remove all HTML attributes with BeautifulSoup
from BeautifulSoup import BeautifulSoup
def _remove_attrs(soup):
for tag in soup.findAll(True):
tag.attrs = None
return soup
def example():
doc = '<html><head><title>test</title></head><body id="foo" onload="whatever"><p class="whatever">junk</p><div style="background: yellow;" id="foo" class="blah">blah</div></body></html>'
@forrestfrazier
forrestfrazier / login
Created December 19, 2010 19:12
log in to web app and return data to be saved in titanium app
//var win = Titanium.UI.currentWindow;
var currentWin = Ti.UI.currentWindow;
// if successful login - save user data to database
function insertRows(dbData) {
// call the database and table
var db = Ti.Database.install('../myapp.sqlite','users');
// call out the info to save then save it
var theData = db.execute('INSERT INTO users (username, email) VALUES("'+name.value+'","'+email.value+'")');
@bobes
bobes / ril_to_instapaper.rb
Created April 13, 2011 06:18
Import your ReadItLater bookmarks into Instapaper
#!/usr/bin/env ruby
# 1. export your RIL bookmarks
# 2. save this file to the same directory where your ril_export.html is
# 3. change username and password in the script bellow
# 4. run 'ruby ril_to_instapaper.rb' in terminal
require "cgi"
require "net/http"
require "net/https"
@chriscoyier
chriscoyier / gist:964905
Created May 10, 2011 17:05
Excellent Web People and their Personal Blogs
Yaron Schoen
http://yaronschoen.com/
http://www.yaronschoen.com/site/atom/
Oli Studholme
http://oli.jp/
http://oli.jp/articles.atom
Ben Bleikamp
http://www.bleikamp.com
@charliepark
charliepark / hatchshow.js
Created July 30, 2011 16:07
A jquery typography plugin.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(window).load(function(){
$().hatchShow();
});
jQuery.fn.hatchShow = function(){
$('.hsjs').css('display','inner-block').css('white-space','pre').each(function(){
var t = $(this);
t.wrap("<span class='hatchshow_temp' style='display:block'>");
var pw = t.parent().width();