Skip to content

Instantly share code, notes, and snippets.

@did
did / wagon.log
Created July 9, 2013 07:38
Basic Wagon logs
# Logfile created on 2013-07-09 09:38:07 +0200 by logger.rb/1.2.8
Started GET "/" at 2013-07-09 09:38:18 +0200
Detecting locale FR
Found page "Jeux concours 4G Orange Sud-Ouest" [index]
Rendered snippet logo_4g
Rendered snippet logo_orange
Rendered snippet google_analytics
Rendered liquid page template
Completed 200 OK in 8.0ms
@did
did / mongoid.yml
Created June 26, 2013 13:18
Mongoid 3.x + Mongohq
development:
sessions:
default:
database: locomotive_dev
hosts:
- localhost:27017
options:
consistency: :strong
options:
identity_map_enabled: true
@did
did / gist:5846697
Last active December 18, 2015 21:19
<script type="text/javascript" src="http://www.lafinancepourtous.com/squelettes/javascript/jquery-1.1.js" language="JavaScript"></script>
<script type="text/javascript" src="http://www.lafinancepourtous.com/calculateurs/budget.js" language="JavaScript"></script>
<script type="text/javascript">
function unhide(form) {
var parent = form.parentElement;
var div = parent.lastChild;
}
function hide(form) {
var parent = form.parentElement;
@did
did / httmultiparty.rb
Created March 25, 2013 00:51
Make Webmock and Httmultparty a happy family (https://github.com/bblimke/webmock/issues/262). It's a dirty monkey patch I'm not ashamed of, mainly because it's only used for tests. Just add the file in your spec/support folder of your app.
require 'webmock'
require 'httmultiparty'
class FakeUploadIO
attr_accessor :original_filename, :content_type, :body
def initialize(io)
io.rewind # make sure....
@did
did / rss.liquid
Created March 1, 2013 15:57
RSS liquid template
---
title: Rss feed
published: true
response_type: rss
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
@did
did / index.liquid.haml
Created February 4, 2013 13:47
refactored home page
---
title: Home page
published: true
---
!!! 5
%html{ lang: "en" }
%head
%meta{ charset: "utf-8" }
%meta{ name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1"}
%link{rel: 'shortcut icon', href: '/images/favicon.ico', type: 'image/x-icon'}
{
"done": "/Users/didier/Documents/NoCoffee/SnifferDog/data/done.csv",
"notifiers": {
"stdout": {},
"jabber": {
"username": "[email protected]",
"password": "<blabla>",
"recipients": ["[email protected]"]
}
},
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/lib'))
require 'bundler'
Bundler.setup
require 'locomotive/builder/version'
require 'locomotive/builder/exceptions'
require 'locomotive/mounter'
# set the working path
~/Documents/LocomotiveCMS/builder/tests/sample_3[wip] > bundle exec builder push development
path = ., {"host"=>"sample.example.com:8080", "email"=>"[email protected]", "password"=>"test31"}
* Pushing Site
en
updating sample_3...........................................................[done]
fr
updating sample_3...........................................................[done]
* Pushing Snippets
en
updating Footer.............................................................[done]
@did
did / mkrf_conf.rb
Created December 11, 2012 18:26
RVM sucks
require 'rubygems'
require 'rubygems/command.rb'
require 'rubygems/dependency_installer.rb'
begin
Gem::Command.build_args = ARGV
rescue NoMethodError
end
inst = Gem::DependencyInstaller.new