Skip to content

Instantly share code, notes, and snippets.

View olalonde's full-sized avatar

Oli olalonde

View GitHub Profile
@olalonde
olalonde / gist:1003860
Created June 2, 2011 03:12
Posterous standard Google +1 button iframe
<iframe src="http://dev.syskall.com/plusone/?url={Permalink}" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" style="border:0;width:110px;height:30px;"></iframe>
@olalonde
olalonde / gist:1003872
Created June 2, 2011 03:28
Posterous tall Google +1 button iframe
<iframe src="http://dev.syskall.com/plusone/?url={Permalink}&size=tall" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" style="border:0;width:50px;height:60px;"></iframe>
@olalonde
olalonde / gist:1954722
Created March 2, 2012 01:43
utility function to compare 2 arrays deeply
// utility function, returns true if arr1 is equal to arr2
function arrays_are_equivalent(arr1, arr2, ret) {
if(ret === undefined) ret = true;
if(arr1.length != arr2.length) return false;
arr1.forEach(function(ele, i) {
if(ele instanceof Array) {
ret = ret && arrays_are_equivalent(ele, arr2[i]);
}
else if(ele !== arr2[i]) {
ret = false;
Testin gist.vim!!
- Oli
// Wrap your modules with this to be able to
// include them in HTML pages using <script>
// Your module will be assigned to the global variable "your_module_name"
// browser compatibility
(function (module) {
var exports = module.exports;
var require = ('function' == typeof require) ? require : function() {};
// /browser compatibility
" Vim color scheme
"
" Name: railscat.vim
" Maintainer: Jeff Kreeftmeijer
" License: public domain
"
" A GUI only extended version of the Railscasts+ theme, that comes with
" Janus [1] and is, in turn, an extension to the original Railscasts theme
" [2], which is a port of the RailsCasts TextMate theme [3] to Vim.
"
var express = require('express');
app.configure(function(){
var cwd = process.cwd();
app.use(express.static(cwd + '/public', {maxAge: 86400000}));
app.set('view engine', 'ejs');
app.set('view options', {complexNames: true});
app.set('jsDirectory', '/javascripts/');
app.set('cssDirectory', '/stylesheets/');
test Gist vim
$ identify
dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/identify
Reason: Incompatible library version: identify requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0
[1] 35189 trace trap identify
> db.eatings.find({'comments._user':ObjectId("507efe91b84ba32892000004")})
{ "__v" : 4, "_id" : ObjectId("507efe56b84ba32892000002"), "_user" : ObjectId("507eecfe12f232ca7d000002"), "comments" : [ { "_user" : ObjectId("507efe91b84ba32892000004"), "body" : "hey that looks delicious", "_id" : ObjectId("507eff37b84ba32892000007"), "createdAt" : ISODate("2012-10-17T18:55:51.311Z") }, { "_user" : ObjectId("507efe91b84ba32892000004"), "body" : "nomnomnom", "_id" : ObjectId("507eff3eb84ba32892000008"), "createdAt" : ISODate("2012-10-17T18:55:58.338Z") }, { "_user" : ObjectId("507eecfe12f232ca7d000002"), "body" : "Thanks :)", "_id" : ObjectId("507f04f131b6665199000003"), "createdAt" : ISODate("2012-10-17T19:20:17.475Z") }, { "_user" : ObjectId("507eecfe12f232ca7d000002"), "body" : "was delicious...", "_id" : ObjectId("507f04f731b6665199000004"), "createdAt" : ISODate("2012-10-17T19:20:23.856Z") } ], "createdAt" : ISODate("2012-10-17T18:52:06.611Z"), "imageUrl" : "https://url", "note" : "", "shotAt