A Pen by Secret Sam on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# pre-commit git hook | |
# will run rspec if and only if current branch is master | |
# script adapted from http://book.git-scm.com/5_git_hooks.html | |
# source : https://gist.github.com/1141992 | |
NO_COMMIT_MESSAGE = "\aDID NOT COMMIT YOUR FILES!" | |
FORMAT = :html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#models/article.rb : | |
require 'persistence_mapper' | |
require_relative '../persistence/lotissement' | |
class Article | |
include Persistence::Mapper | |
end | |
#persistence/article.rb : | |
module Persistence |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def to_boolean | |
compare_value = self.class == String ? self.downcase : self | |
case compare_value | |
when "no","false",false, "0", 0 | |
false | |
when "yes","true",true, "1", 1 | |
true | |
else | |
!!compare_value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FormBuilder for Ruby on Rails which produces HTML code compatible with Twitter Bootstrap | |
# horizontal forms styles (see here: http://twitter.github.com/bootstrap/base-css.html#forms) | |
# | |
# Features: | |
# * displays validation errors in-line | |
# * has custom option - label-text - to override default label text for an input | |
# | |
# Requirements: | |
# By default, Rails will wrap a field with validation error in an ugly div tag that breaks | |
# the layout. To override this behaviour, add |
- Create website in Piwik and get its idsite
- Create a directory for this website in /home/analytics/website_logs/ and create in it a directory parsed
For example.org, create /home/analytics/website_logs/example.org dir and /home/analytics/website_logs/example.org/parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#================================================================ | |
# HEADER | |
#================================================================ | |
#% SYNOPSIS | |
#+ ${SCRIPT_NAME} [-hv] [-o[file]] args ... | |
#% | |
#% DESCRIPTION | |
#% This is a script template | |
#% to start any good shell script. |