Skip to content

Instantly share code, notes, and snippets.

View heralight's full-sized avatar

Alexandre Richonnier heralight

View GitHub Profile
@keo
keo / bootstrap.sh
Last active January 25, 2024 15:49
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@millermedeiros
millermedeiros / build.js
Created May 9, 2012 01:15
sample node.js build script including RequireJS optimizer (r.js) and copy/delete/filter files
// Combine JS and CSS files
// ---
//
// Make sure you install the npm dependencies
// > cd YOUR_PROJECT_FOLDER
// > npm install
//
// Than run:
// > node build
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
def itemListActionsTemplate : NodeSeq = <xml:group>
<a crud:edit_href="" title={S.??("edit")} class="ss_sprite ss_pencil" ></a>
<a crud:delete_href="" title={S.??("delete")} class="ss_sprite ss_delete"></a>
</xml:group>
def itemListActions(item: CrudType, in:NodeSeq):NodeSeq = {
bind("crud", in,
AttrBindParam("edit_href", Text(editItemPathString+"/"+ (obscurePrimaryKey(item))),"href"),
AttrBindParam("view_href", Text(viewPathString+"/"+(obscurePrimaryKey(item))),"href"),
AttrBindParam("delete_href", Text(deletePathString+"/"+ (obscurePrimaryKey(item))),"href")
@wireframe
wireframe / gist:75088
Created March 6, 2009 21:53
jquery plugin to truncate elements based on height instead of number of characters
/*
truncates elements that pass a certain height.
adds a "view more" link to display the rest of the content.
a different approach than standard truncation which relies on character counting.
character counting may not be desireable when elements have short words, but a
number of line breaks.
usage:
//using defaults