Skip to content

Instantly share code, notes, and snippets.

@fny
fny / sendmail.mc
Created January 11, 2012 23:14
Updated prototype config file for building Sendmail 8.14.3 on Debian Squeeze
divert(-1)dnl
#-----------------------------------------------------------------------------
# $Sendmail: debproto.mc,v 8.14.3 2010-09-21 11:05:34 cowboy Exp $
#
# Copyright (c) 1998-2009 Richard Nelson. All Rights Reserved.
#
# cf/debian/sendmail.mc. Generated from sendmail.mc.in by configure.
#
# sendmail.mc prototype config file for building Sendmail 8.14.3
#
@fny
fny / jquery.regex-selector.js
Created February 22, 2012 21:22
Regex Selector for jQuery - James Padolsey
jQuery.expr[':'].regex = function(elem, index, match) {
var matchParams = match[3].split(','),
validLabels = /^(data|css):/,
attr = {
method: matchParams[0].match(validLabels) ?
matchParams[0].split(':')[0] : 'attr',
property: matchParams.shift().replace(validLabels,'')
},
regexFlags = 'ig',
regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
@fny
fny / pinboard-full.js
Created February 25, 2012 03:26 — forked from BenWard/pinboard-full.js
A smarter bookmarklet for Pinboard.in; wraps selected text in <blockquote> tags, keeps variables out of the global scope, supports filling tags from rel="tag" markup in the page, and titles from hAtom entry titles.
(function() {
// Change `silent` to true to invoke the promptless, self-closing
// version of the bookmarklet.
var silent = false;
var url = location.href;
var title = document.title;
// Look for a single hAtom entry on the page, and iff one is found, extract
// the entry-title in place of the document title:
@fny
fny / README
Created February 25, 2012 03:47
Dropbox Uploader Script
Author: Andrea Fabrizi
Email: andrea.fabrizi@gmail.com
Web: http://www.andreafabrizi.it
Dropbox Uploader is a BASH script which can be used to upload files to Dropbox,
an online file sharing, synchronization and backup service.
It's written in BASH scripting language and only needs cURL (CLI).
Usage: ./dropbox_uploader.sh [OPTIONS]...
@fny
fny / add_bookmark.jquery.js
Created February 25, 2012 04:21
Add Bookmark Script
/*!
* Copyright 2006-2011 Dynamic Site Solutions.
* Free use of this script is permitted for non-commercial applications,
* subject to the requirement that this comment block be kept and not be
* altered. The data and executable parts of the script may be changed
* as needed. Dynamic Site Solutions makes no warranty regarding fitness
* of use or correct function of the script. Terms for use of this script
* in commercial applications may be negotiated; for this, or for other
* questions, contact "license-info@dynamicsitesolutions.com".
*
@fny
fny / getstyle.js
Created February 25, 2012 04:24
GetStule Function
/*
* Copyright 2008 Dynamic Site Solutions.
* Free use of this script is permitted for commercial and non-commercial
* applications, subject to the requirement that this comment block be kept
* and not be altered. The data and executable parts of the script may be
* changed as needed. Dynamic Site Solutions makes no warranty regarding
* fitness of use or correct function of the script. If you would like help
* customizing this script or if you have other questions, contact
* "contact_us@dynamicsitesolutions.com".
*
@fny
fny / drop
Created February 25, 2012 04:53
Simple shell script to copy a file to a Dropbox public folder and get its URL. Needs socat and xclip.
#!/bin/sh
#
# Simple shell script to copy a file to the Dropbox
# public folder and get its URL.
#
# The URL of the last file copied also stays on the
# X clipboard.
#
# Symlink the script as dropmv to move the file to the
# public folder instead of copying it.
@fny
fny / gist:2361272
Created April 11, 2012 18:39 — forked from eriwen/gist:187610
Pythonic site monitor
#!/usr/bin/env python
# sample usage: checksites.py eriwen.com nixtutor.com yoursite.org
import pickle, os, sys, logging
from httplib import HTTPConnection, socket
from smtplib import SMTP
def email_alert(message, status):
fromaddr = 'you@gmail.com'
@fny
fny / dabblet.css
Created April 15, 2012 05:48 — forked from dgmid/dabblet.css
Animated HTML5 / CSS3 image caption - Example 6
/**
* Animated HTML5 / CSS3 image caption - Example 6
*/
/* page styles */
body{
background: #fff;
min-height:100%;
}
@fny
fny / benchmark.rb
Created April 17, 2012 01:12
Benchmark from the Ruby Standard Library
module Benchmark
BENCHMARK_VERSION = "2002-04-25" #:nodoc"
# Invokes the block with a <tt>Benchmark::Report</tt> object, which
# may be used to collect and report on the results of individual
# benchmark tests. Reserves <i>label_width</i> leading spaces for
# labels on each line. Prints _caption_ at the top of the
# report, and uses _format_ to format each line.
# Returns an array of Benchmark::Tms objects.