Skip to content

Instantly share code, notes, and snippets.

Florian Cargoët floriancargoet

View GitHub Profile
@floriancargoet
floriancargoet / Makefile
Last active May 5, 2017
Love2D Android Makefile
View Makefile
# Put this Makefile in love-android-sdl2/
# Put your Lua files in love-android-sdl2/assets/game/
src_path := assets/game
src_files := $(wildcard $(src_path)/*)
# do not change
love_file := assets/game.love
apk_file := bin/love-android-debug.apk
# if you change these, update AndroidManifest.xml and source
app_package := org.love2d.android
View psqlfix.sh
psql postgres -c "update pg_database set datallowconn = TRUE where datname = 'template0';"
psql template0 -c "update pg_database set datistemplate = FALSE where datname = 'template1';"
psql template0 -c "drop database template1;"
psql template0 -c "create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.UTF-8' lc_ctype='en_US.UTF-8' template template0;"
psql template0 -c "update pg_database set datistemplate = TRUE where datname = 'template1';"
psql template1 -c "update pg_database set datallowconn = FALSE where datname = 'template0';"
@floriancargoet
floriancargoet / arrow_this.js
Last active Aug 29, 2015
ECMAScript 6 quiz
View arrow_this.js
let thing = {
method1() {
[1].forEach(x => {
console.log(this === thing)
});
},
method2() {
[1].forEach(function () {
console.log(this === thing)
@floriancargoet
floriancargoet / ellipse.js
Created Mar 17, 2015
ctx.ellipse polyfill
View ellipse.js
var ctx = document.getElementById('c').getContext('2d');
function ellipse(context, cx, cy, rx, ry, rot, aStart, aEnd){
context.save();
context.translate(cx, cy);
context.rotate(rot);
context.translate(-rx, -ry);
context.scale(rx, ry);
context.arc(1, 1, 1, aStart, aEnd, false);
View keybase.md

Keybase proof

I hereby claim:

  • I am floriancargoet on github.
  • I am floriancargoet (https://keybase.io/floriancargoet) on keybase.
  • I have a public key ASC6yjGjO1X7rAiK1uueJKX-PhwzWmQdhdxA96vo0YThSQo

To claim this, I am signing this object:

View trello-grid
javascript:(function(){$('.list-area').css('max-width','100%');$('.list').css('margin','10px 0 0 10px');var max = Math.max.apply(null,$('.list').map(function(){return $(this).height();}));$('.list').each(function(){$(this).css('margin-bottom', max - $(this).height())});})();
View features.md

Inspiration: Lua, JavaScript, Circa, promises, reactive programming

Base concepts:

  • base object === map (no properties or methods)

    map = {}
    map.toString // null
    
View codestyle.md

Code Style

  • 4 spaces indentation
  • Single-quotes
  • Semicolon
  • ===, !==
  • x == null (instead of x === null || x === undefined)
  • No trailing whitespace
  • Variables were needed
  • Multiple variable statements
@floriancargoet
floriancargoet / Radar.js
Created Jun 15, 2012
Bug Touch Charts 2
View Radar.js
Ext.define('Ext.chart.series.Radar', {
// ...
getLegendLabels: function() {
var label = this.title || this.getYField();
return label ? [label] : [];
}
// ...
});
/*
You can’t perform that action at this time.