Public Gists by chrislloyd

Gravatar
Wed Nov 18 16:52:24 -0800 2009
1
2
3
class Integer
  def prime?
    ("1" * self).match(/^1?$|^(11+?)\1+$/).nil?
Gravatar
Fri Nov 13 01:32:26 -0800 2009
1
2
3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
Gravatar
Tue Nov 10 17:11:53 -0800 2009
1
2
3
var welcome = $.view(function(n, data) {
 
  n('%h2', 'Forgetting something?');
Gravatar
Mon Nov 09 16:07:15 -0800 2009
1
2
3
var welcome = $.view(function(n, data) {
  if(foo) {
    n('.description', function(desc){
Gravatar
Sat Nov 07 20:24:46 -0800 2009
1
2
3
/* Instructions:
 *
 * Download to ~/.mailplane.css
Gravatar
Mon Oct 26 23:50:03 -0700 2009
1
2
3
require 'exemplor'
 
def perf(msg='')
Gravatar
Sun Oct 18 22:03:36 -0700 2009
1
2
3
require 'exemplor'
 
class MyObject
Gravatar
Sun Oct 18 18:20:57 -0700 2009
1
2
3
require 'statemachine'
require 'exemplor'
 
Gravatar
Wed Sep 30 18:46:31 -0700 2009
1
2
3
$$ = function(elem, methods) {
  if(methods) $(elem).data('controller', methods);
  return $(elem).data('controller');
Gravatar
Sun Sep 06 19:58:34 -0700 2009
1
2
3
// global set by server
COMMENTS = [{
    'title': 'hello',
Gravatar
Fri Aug 28 06:10:47 -0700 2009
1
2
3
Hadamard * create_lookup(Dim N){
/* CREATE_LOOKUP Returns a pointer to a structure containing the lookup table of dimension N.
N The dimensions of the resulting matrix will be 2NxN
Gravatar
Mon Aug 03 04:18:37 -0700 2009
1
2
3
(function($){
    $.fn.grid = function() {
        return this.each(function(){
Gravatar
Thu Jul 30 18:39:58 -0700 2009
1
2
3
html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,a,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,dialog,figure,footer,header,hgroup,menu,nav,section,menu,time,mark,audio,video
  :margin 0
  :padding 0
Gravatar
Mon Jun 29 18:40:52 -0700 2009
1
2
3
function max() {
    if(arguments[0].length === 0) {return arguments[1] || NaN;}
    else {
Gravatar
Mon Jun 15 21:12:54 -0700 2009
1
0,128,128,544,128,1040,128,672,320,49284,33088,544,128,144,0,128
Gravatar
Thu May 28 03:49:00 -0700 2009
1
2
3
DROP TABLE Audit;
 
CREATE TABLE Audit (
Gravatar
Tue May 19 22:26:54 -0700 2009
1
2
3
class Table
  include InheritableClassAttributes
 
Gravatar
Wed May 06 05:56:27 -0700 2009
1
2
3
Registration.find_all_by_complete(true).each_with_object({}) do |reg, count|
  date = reg.sydney_updated_at.to_date
  count[date] ||= 0
Gravatar
Tue Apr 28 18:51:38 -0700 2009
1
2
3
require 'active_record/fixtures'
 
namespace :db do
Gravatar
Fri Mar 27 19:45:11 -0700 2009
1
2
3
#!/bin/bash
 
## Simple tests for the questions