Skip to content

Instantly share code, notes, and snippets.

<form action="https://launchpad.37signals.com/authenticate" method="post">
<input name="product" value="YOUR-PRODUCT" type="hidden" />
<input name="subdomain" value="YOUR-SUBDOMAIN" type="hidden" />
<p>Username<br />
<input name="username" id="username" type="text" /></p>
<p>Password<br />
<input name="password" id="password" type="password" /></p>
@uhlenbrock
uhlenbrock / deploy.rb
Created January 25, 2010 21:47
Simple Capistrano recipe for Jekyll
set :application, 'foo'
set :repository, '_site'
set :scm, :none
set :deploy_via, :copy
set :copy_compression, :gzip
set :use_sudo, false
set :host, '127.0.0.1'
role :web, host
role :app, host
@mrcgrtz
mrcgrtz / placeholder.js
Created April 21, 2010 10:29
Adds something like HTML5 placeholders when they are not supported by your browser. Usage: <input placeholder="Foobar">
var MyApp = {
addPlaceholders: function(props) {
// default configuration
var config = {
'class': 'placeholder' // apply CSS classes to an input displaying a placeholder
};
// if any properties were supplied, apply them to the config object
@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
@Kilian
Kilian / annoying.js
Created January 6, 2011 15:04
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@IskanderHaziev
IskanderHaziev / gist:774711
Created January 11, 2011 16:58
parsing cloudfront logs
require 'rubygems'
require 'zlib'
require 'aws/s3'
def parse_cloudfront_line(line)
return if line.strip.match(/^#/)
bytes = line.split("\t")[5]
filename = line.split("\t")[13]
info = {:file => filename, :bytes => bytes}
info if filename.strip != '-'
@danott
danott / modernizr-tests.js
Created March 4, 2011 16:55
Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@jamescarlos
jamescarlos / campfire_message.php
Created April 6, 2011 05:49
Send a message to campfire
<?php
// Usage and set up
// change your-site to the subdomain being used for your campfire url
// use the api token for the user you want posting the message
// set the room id that you want the message to be posted to
define('CAMPFIRE_URL', 'https://your-site.campfirenow.com/');
define('CAMPFIRE_API_TOKEN', 'apitokengoeshere');
$room_id = 12345;
$message = 'I are a robot.';
@scottjehl
scottjehl / anchorinclude.js
Created May 20, 2011 17:04
Anchor-include Pattern
/*
* anchor-include pattern for already-functional links that work as a client-side include
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT
* Idea from Scott Gonzalez
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
* after the page has loaded
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a>
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a>
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>