Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar

Wil (₩) Moore III wilmoore

View GitHub Profile
@wilmoore
wilmoore / gist:482700
Created July 20, 2010 08:42 — forked from effkay/gist:203997
UTF-8 Development Notes
Just for everyone's information, if you want to run purely utf8, don't forget the following:
httpd.conf:
AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8
php.ini
default_charset = "utf-8"
my.cnf
@mnutt
mnutt / Instrument Anything in Rails 3.md
Created September 6, 2010 06:50
How to use Rails 3.0's new notification system to inject custom log events

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)

@paulirish
paulirish / gist:576335
Created September 12, 2010 19:05
Things to do when IE9 Beta comes out

Things to do when IE9 Beta comes out

Note significant features added since IE9 PP4

  • Implemented but not announced: box-shadow, hsla
  • Expecting: 2d transforms, css animation, css transitions, flexible box model
  • Maybe: gradients, columns, reflections, svg filters, uncrippling @font-face, 3d transforms
  • Maybe version auto-update functionality

Test Modernizr against it

  • Does it still throw an error checking elem.msTransform?
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
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
// HOWTO: load LABjs itself dynamically!
// inline this code in your page to load LABjs itself dynamically, if you're so inclined.
(function (global, oDOC, handler) {
var head = oDOC.head || oDOC.getElementsByTagName("head");
function LABjsLoaded() {
// do cool stuff with $LAB here
}
<?php
error_reporting(E_STRICT | E_ALL);
class ImmutableValueObject extends \ArrayObject
{
public function __construct(array $data = array(), $flags = \ArrayObject::ARRAY_AS_PROPS)
{
parent::__construct($data, $flags);
}
@ornicar
ornicar / gist:670839
Created November 10, 2010 13:19
Git + ZendFramework submodule = modified: src/vendor/zend because of CRLF: the workaround
It's a shame, but https://github.com/zendframework/zf2 contains dozens of files with CRLF issues.
If like me, you set your Git core.autocrlf to true, then your ZendFramework submodule is always modified:
$ git status
# On branch master
# Changed but not updated:
#
# modified: src/vendor/zend
To fix it, you can set Git core.autocrlf to false *only for this submodule*.
anonymous
anonymous / code_thievery.txt
Created November 25, 2010 03:28
> JimBastard: "If you question the legitimacy or ownership
> of any of my projects..."
Well, let's do just that. JimBastard, aka Marak Squires, has a long
history of self-promoting projects that he's either stolen outright
from other programmers, or simply wrapped and called his own.
You'll often find him promoting his "work", so watch this video
before continuing:
http://www.youtube.com/nodejitsu#p/a/u/0/eRISZCk4IE0
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@ihelmke
ihelmke / kvmnotes
Created December 4, 2010 00:38
KVM Crew Project Notes
XEN->KVM Migration Project Notes
Author: Ian Helmke ([email protected])
Author: Mike Coppola ([email protected])
Description: This document is intended as a guide detailing our
findings, considerations, and thoughts regarding the XEN-KVM migration
of CCIS linux XEN hosts. In it, we will describe (directly or
abstractly) the process of performing many different KVM tasks that we