Skip to content

Instantly share code, notes, and snippets.

View bpierre's full-sized avatar
✌️

Pierre Bertet bpierre

✌️
View GitHub Profile
@raphaelbastide
raphaelbastide / correction.md
Last active August 29, 2015 14:01
Brackets notation

Plain text notation for correction and review

This document has now its own repository.

How to use brackets [ ] to advise lossless corrections.

In short

[1][2][3]
## Colours and font styles
## Syntax: echo -e "${FOREGROUND_COLOUR}${BACKGROUND_COLOUR}${STYLE}Hello world!${RESET_ALL}"
# Escape sequence and resets
ESC_SEQ="\x1b["
RESET_ALL="${ESC_SEQ}0m"
RESET_BOLD="${ESC_SEQ}21m"
RESET_UL="${ESC_SEQ}24m"
# Foreground colours
@domenic
domenic / .bashrc
Last active September 1, 2015 17:50
.bashrc with GitHub PR function
pr () {
git fetch origin refs/pull/$1/head:refs/remotes/origin/pr/$1 --force
git checkout -b pr/$1 origin/pr/$1
git rebase master
git checkout master
git merge pr/$1 --ff-only
}
@mrdoob
mrdoob / gist:845802
Created February 27, 2011 01:09
video to looped animated gif
ffmpeg -i out.ogv -s 160x128 -pix_fmt rgb24 -ss 62.6 -t 3 -r 5 -loop 0 -f gif out.gif
convert -loop 0 -layers Optimize out.gif outopt.gif
@raphaelbastide
raphaelbastide / raphael.default.js
Created June 12, 2011 14:06
Public modul packs
var ctx = modul.context;
function skin_Default() {
ctx.clearRect(0,0,50,50);
// modul.io DEFAULT SKIN
ctx.beginPath();
// Here is a trick to random the modul's color:
ctx.fillStyle="rgba(" + Math.floor( Math.random() * 255) + "," + Math.floor( Math.random() * 255) + "," + Math.floor( Math.random() * 255) + ",1)";
//eyes
ctx.fillRect(12,3, 4, 4);
@getify
getify / ex1.php
Created August 12, 2012 14:15
exploring inline decision-logic in templates
<!-- here's the PHP'ish way of making inline decisions while constructing HTML markup -->
<select name="foobar">
<option value="bam" <?=($foobar==="bam"?"selected":"")?>>Bam</option>
<option value="baz" <?=($foobar==="baz"?"selected":"")?>>Baz</option>
</select>
<input type="radio" name="foobar" value="bam" <?=($foobar==="bam"?"checked":"")?>> Bam
<input type="radio" name="foobar" value="baz" <?=($foobar==="baz"?"checked":"")?>> Baz
@padolsey
padolsey / 1.js
Created February 21, 2013 21:26
A little JS [ES3] task: In each case, implement `x` so that the expression is true. Do not modify the expressions though. Post your solutions as a fork of this gist. ***Remember: ES3 only.
/x/==x
@max-mapper
max-mapper / readme.md
Last active December 14, 2015 14:58
js 'pagelet' concept

pagelet

tries to provide a way to use NPM to distribute web components with as little abstraction as possible

  • uses plain index.js, style.css, index.html etc
  • works in multiple environments

example (intentionally verbose)

consider a module called 'simple-button':

@mahemoff
mahemoff / semver.sh
Created December 17, 2015 12:16
Aliases to support semantically-versioned git tags
# First install https://github.com/flazz/semver
# With this script, you can run "vminor add more cowbell" or just "vminor"
function vbump() {
level=$1
semver inc $level
shift
git tag -a $(semver tag) -m "${*:-bump}"
git tag -n9 | grep `git describe` # show annotated
}
@indexzero
indexzero / top-30.md
Last active December 22, 2015 07:48
Top 30 Episodes of Futurama

The Top 30 Futurama Episodes of ALL-TIME

30. (S10E12) Murder on the Planet Express

" Wait, wait, wait, wait, you can't give everybody guns!"

29. (S02E16) The Deep South