Skip to content

Instantly share code, notes, and snippets.

@kenzie
kenzie / quicksilver_score.php
Created April 29, 2010 11:26
Quicksilver string ranking algorithm in PHP
<?
// Quicksilver Score
//
// A port of the Quicksilver string ranking algorithm
// (re-ported from Javascript to PHP by Kenzie Campbell)
// http://route19.com/logbook/view/quicksilver-score-in-php
//
// score("hello world","axl") //=> 0.0
// score("hello world","ow") //=> 0.6
@reid
reid / README.md
Created April 26, 2011 19:47
Reid's YUI Compressor Fork HOWTO

Reid's YUI Compressor Fork

I've created a fork of YUI Compressor that will be integrated into a future official version. It makes YUI Compressor more friendly to build systems.

Warning

The code you're about to use and these instructions come with absolutely no warranty. See the [LICENSE][] file for details.

Even though I'm on the YUI team, this is not yet a part of the official YUI project. It comes with zero support. This may break your builds and set fire to your office.

var express = require('./')
, http = require('http')
, https = require('https')
, app = express.createServer();
app.use(express.static(__dirname));
http.createServer(app.handle.bind(app)).listen(3000);
https.create....
@axelav
axelav / gist:1839777
Created February 15, 2012 22:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@aheckmann
aheckmann / something.js
Created March 27, 2012 12:15
mongoose: emit update or create
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
mongoose.connect('localhost', 'testing_emitUpdate');
var schema = new Schema({
name: String
});
schema.pre('save', function (next) {
@magnetikonline
magnetikonline / README.md
Last active June 7, 2023 20:57
AWS Elastic Beanstalk deploy user restricted IAM policy.

AWS Elastic Beanstalk deploy user restricted IAM policy

An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.

Where:

  • REGION: AWS region.
  • ACCOUNT_ID: AWS account ID.
  • APPLICATION_NAME: Desired target Elastic Beanstalk application name(space).
  • IAM_INSTANCE_PROFILE_ROLE: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.