This file contains hidden or 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
## Enable this to restrict editing to logged in users only | |
## You should disable Indexes and MultiViews either here or in the | |
## global config. Symlinks maybe needed for URL rewriting. | |
Options -Indexes -MultiViews +FollowSymLinks | |
## make sure nobody gets the htaccess files | |
<Files ~ "^[\._]ht"> | |
Order allow,deny | |
Deny from all |
This file contains hidden or 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
# Source: https://gist.github.com/isaacs/579814 | |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains hidden or 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# don't overwrite GNU Midnight Commander's setting of `ignorespace'. | |
HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups |
This file contains hidden or 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/sh | |
# | |
# Submit a single test on LSF | |
# Wrapper around bsub command, then process log result. | |
# | |
# This script is used by run-tests-async.sh | |
# | |
# Usage: | |
# | |
# ./bsub.sh $command |
This file contains hidden or 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
/*** | |
* NodeJS module that implements the single pattern. | |
* http://en.wikipedia.org/wiki/Singleton_pattern | |
* | |
* The goals is to create the object: instance only one time | |
* thus the instance is shared in the source code. | |
* | |
* You must be aware that there is a risk to break | |
* the isolation principles. | |
*/ |
This file contains hidden or 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
# Example of Grouping with Ruby | |
# features: group_by, Array, collection, subgroup | |
# Here the collection | |
# where #{group_name}_#{subgroup0}_#{subgroup1}... | |
collection = ['AA_A_B_C', 'BB_A_B_C', 'CC_A_B_C', 'AA_A_A_A', 'BB_B_B_B'] | |
# To range allow to convert | |
# a subgroup to a range | |
# |
This file contains hidden or 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
# Remove a line from a file. Ruby 1.9 > | |
ruby -i.bak -ne 'print if not /POR_CHIE_DAT_RSVDC_WIDTH_PARAM|HNF_SLC_DSLICE_PARAM/' spec/porter_1_*.yml |
This file contains hidden or 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/usr/env ruby | |
# | |
# Ruby script to render a YAML file with a nice format. | |
# Read a YAML file format and render like JSON. | |
# | |
# File: input.yml | |
# { | |
# key1: "value", | |
# key2: { | |
# key3: "value3" |
This file contains hidden or 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
# Ruby Webrick example of Virtual Host | |
# | |
# Your directory must contain a public/index.html file. | |
# | |
require 'webrick' | |
require 'json' | |
# Daemonize (production) | |
#WEBrick::Daemon.start |
This file contains hidden or 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
# Ruby mongoDB map reduce | |
# The mongoDB documentation missed totally to | |
# describes a simple usage for map reduce in Ruby. | |
# and the web is full of misleading example based on the previous API. | |
# | |
# This gist try to fill out the gap. | |
# First please read https://docs.mongodb.org/manual/tutorial/map-reduce-examples/ | |
# below it is a simple Ruby implementation. | |
# | |
# @doc https://docs.mongodb.org/manual/core/map-reduce/ |