Skip to content

Instantly share code, notes, and snippets.

View gfortaine's full-sized avatar

Guillaume FORTAINE gfortaine

View GitHub Profile
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@lrvick
lrvick / bitcolor.js
Created March 18, 2012 20:02
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
<script>
// fbAsyncInit
// http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId: '<?php echo(FB_APP_ID); ?>',
status: true,
cookie: true,
xfbml: true,
var init = sync(function* (resume) {
var data1, data2;
console.log('Start by waiting for a second...');
yield sleep(1000, resume);
console.log('Then send a GET request to a couple of websites with XMLHttpRequest');
data1 = yield get('https://cors-test.appspot.com/test', resume);
@mbbx6spp
mbbx6spp / README.md
Last active May 28, 2024 13:52
Gerrit vs Github for code review and codebase management

Gerrit vs Github: for code review and codebase management

Sure, Github wins on the UI. Hands down. But, despite my initial annoyance with Gerrit when I first started using it almost a year ago, I am now a convert. Fully. Let me tell you why.

Note: This is an opinionated (on purpose) piece. I assume your preferences are like mine on certain ideas, such as:

  • Fast-forward submits to the target branch are better than allowing merge commits to the target branch. The reason I personally prefer this is that, even if a non-conflicting merge to the target branch is possible, the fact that the review/pull request is not up to date with the latest on the target branch means feature branch test suite runs in the CI pipeline reporting on the review/PR may not be accurate. Another minor point is that forced merge commits are annoying as fuck (opinion) and clutter up Git log histories unnecessarily and I prefer clean histories.
  • Atomic/related changes all in one commit is something worth striving for. Having your dev
@adrienjoly
adrienjoly / startup-noob-guide.md
Last active March 31, 2024 04:37
Startup Noob Guide: Tips and resources on how to test, develop your startup idea, or find a developer/associate/CTO

Startup Noob Guide (bit.ly/startupnoob)

If you want to create a startup, and you've never done that before, you should consult the resources that are relevant to your situation.

[FR] Si vous comprenez le français, je vous invite à regarder la vidéo de mon pote Shubham qui résume assez bien le plus gros des conseils de cette page, en 8 minutes: Vous avez une idée de startup ?.

[FR] ...et si vous voulez comprendre tout ce contenu de manière plus efficace et ludique, inscrivez-vous sur mon MOOC "Startup Tour: créez votre startup en 3h" (gratuit).


@rmunn
rmunn / git-prompt-howto.md
Created March 9, 2016 03:13
How to get a nice Bash prompt that includes your current Git branch

Edit your .bashrc as follows. Before the "case $TERM" statement that sets color_prompt, add the following:

# GNOME Terminal is broken re: $TERM settings
if [ "$COLORTERM" = "gnome-terminal" -a "$TERM" = "xterm" ]; then
    TERM="xterm-256color"
fi

Now edit that "case $TERM" statement to look like this:

@delphinus
delphinus / generator-test.js
Created June 18, 2016 04:31
Javascript Generator のテスト
(() => {
function range(n) {
let value = 0;
return {
next() {
if (value < n) {
const result = {value, done: false};
value += 1;
return result;
}
@addyosmani
addyosmani / route-based-chunking.md
Last active December 28, 2021 06:18
Route-based chunking

Route-based chunking

Many of us building single-page apps today use JavaScript module bundling tools that trend towards a monolithic "bundle.js" file including the full app and vendor code for multiple routes. This means if a user lands on any arbitrary route they need to wait for a large bundle of JS to be fetched, parsed and executed before the application is fully rendered and interactive.

screen shot 2016-09-28 at 4 45 52 pm

This is a little backwards, especially when apps are used under real-world network (3G) and device