Skip to content

Instantly share code, notes, and snippets.

View alepee's full-sized avatar

Antoine Lépée alepee

View GitHub Profile
@jprivet-dev
jprivet-dev / memo-forum-php-2017-ecrire-tests-long-terme-charles-desneuf.adoc
Last active October 16, 2019 11:18
[Mémo] Forum PHP 2017 - Écrire des tests pour le long terme (Charles Desneuf) | https://youtu.be/Bjw6N7bjzf4
:toc: macro
:toc-title: Sommaire
:toclevels: 3
:numbered:
ifndef::env-github[:icons: font]
ifdef::env-github[]
:status:
:outfilesuffix: .adoc
:caution-caption: :fire:
@sroccaserra
sroccaserra / 2017-06-15_Entropie_du_logiciel.md
Last active April 27, 2022 12:15
Entropie du logiciel : dette technique et complexité accidentelle (Agile France 2017)

Entropie du logiciel : dette technique et complexité accidentelle

2017-06-15

Mes notes sur la session de @Lilobase à @AgileFrance 2017.

Voir aussi : les slides de la session.

Qu'est-ce qui fait qu'un système logiciel est pourri ? Note : au niveau

@ElliotChong
ElliotChong / KineticJS-PixelRatio_Override.coffee
Last active December 20, 2015 09:29
KineticJS automatically detects the current device's pixel ratio and renders graphics accordingly so that they will be as crisp as possible on high DPI displays. Sometimes you'd like to opt for a less precise (fuzzier) rendering but higher average framerate, this gist will give you that control.
# Adjust device pixel ratio
setMaximumPixelRatio = (p_maximumRatio=1) ->
canvas = document.createElement('canvas')
context = canvas.getContext('2d')
devicePixelRatio = window.devicePixelRatio || 1
backingStoreRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1
pixelRatio = devicePixelRatio / backingStoreRatio
for className in ["HitCanvas", "SceneCanvas", "Canvas"]
Kinetic[className].prototype.init = ((p_method) -> (p_config={}) ->
@bennadel
bennadel / lazy-loading-images.htm
Created July 23, 2013 13:04
Lazy Loading Image With AngularJS
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Lazy Loading Images With AngularJS
</title>
<style type="text/css">
@DiegoSalazar
DiegoSalazar / validate_credit_card.js
Last active April 24, 2024 12:51
Luhn algorithm in Javascript. Check valid credit card numbers
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active May 17, 2024 08:05
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,
@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#