Skip to content

Instantly share code, notes, and snippets.

@loickreitmann
loickreitmann / jQuery.cookie.js
Created September 14, 2012 17:23
jQuery.cookie
@loickreitmann
loickreitmann / iphoto-find-mov-copy-renamed.rb
Last active December 10, 2015 07:58
Find .MOV files in iPhoto directories, then copy them to another path with a new name based on creation date "YYYY-MM-DD_HHMMSS.MOV" (last modified, because there is no "creation date").
# was writen and run on system with Ruby 1.8.7
require 'find'
require 'fileutils'
src_dir = '/path/to/iPhoto Library/Masters'
out_dir = '/path/wher/you/want/to/save/you/ruby-copy/'
count = 0
new_count = 0
Find.find(src_dir) do |path|
if not FileTest.directory?(path)

Amazon Linux AMI with Node/NPM and Nginx

Installation

1. Create a Amazon Linux AMI instance on AWS/EC2

2. Connect to your instance with SSH

3. Update your instance:

@loickreitmann
loickreitmann / styles.less
Last active August 29, 2015 14:03
My custom Atom.io styles
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@loickreitmann
loickreitmann / caesarShift.js
Last active August 30, 2015 01:22
Javascript version of Caesar shift
function crypt(message, shiftText, isDecrypt) {
'use strict';
return caesarShift(message.toUpperCase(), getShift(shiftText, isDecrypt));
}
function getShift(shiftText, isDecrypt) {
var shift;
if (isNaN(shiftText) && !/^-?\d+$/.test(shift)) {
console.log("Shift is not an integer");
return 0;
}