Skip to content

Instantly share code, notes, and snippets.

View yarmand's full-sized avatar

yann ARMAND yarmand

View GitHub Profile
@yarmand
yarmand / favtext.js
Created November 27, 2012 13:55
Draw text on favicon
(function () {
var canvas = document.createElement('canvas'),
ctx,
img = document.createElement('img'),
link = document.getElementById('favicon').cloneNode(true),
day = (new Date).getDate() + '';
if (canvas.getContext) {
canvas.height = canvas.width = 16; // set the size
ctx = canvas.getContext('2d');
@yarmand
yarmand / gist:3721326
Created September 14, 2012 11:05
2012-09-14 reset_environment do not work for me
[vagrant@u64 workfeed]$ rake --trace dev:reset_environment
(in /opt/workfeed)
** Invoke dev:reset_environment (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute dev:reset_environment
** Invoke restart (first_time)
** Execute restart
memcached(1526): Operation not permitted
memcached: no process found
@yarmand
yarmand / gist:3721309
Created September 14, 2012 11:00
2012-09-14 migration error
rake db:migrate
(in /opt/workfeed)
== PreMigrateTask: started.
-- /opt/workfeed/db/pre_migrate/000_pg_log_type.sql
NOTICE: drop cascades to 13 other objects
DETAIL: drop cascades to function "pg_log$get_log_data"(timestamp without time zone,timestamp without time zone,text,boolean)
drop cascades to view all_queries_td
drop cascades to view all_queries_wk
drop cascades to view all_queries_mn
drop cascades to view ddl_queries_td
@yarmand
yarmand / object_extend_sample.rb
Created May 22, 2012 20:10
extending an object
module AdditionalMethods
def new_method
"do some things"
end
end
obj = SomeObject.new
obj.extend(AdditionalMethods)
puts obj.new_method
@yarmand
yarmand / gist:1193672
Created September 4, 2011 22:58
coffeeScript global var
window.foo= () -> console.log('foo')
@yarmand
yarmand / mongoid.yml
Created May 21, 2011 16:36
mongoid for heroku
defaults: &defaults
host: localhost
# slaves:
# - host: slave1.local
# port: 27018
# - host: slave2.local
# port: 27019
development:
<<: *defaults