Skip to content

Instantly share code, notes, and snippets.

View fcamblor's full-sized avatar

Frédéric Camblor fcamblor

View GitHub Profile
@fcamblor
fcamblor / createCFPManualVote-bookmarklet.js
Last active January 23, 2018 07:43
DevoxxFR CFP UI goodness to facilitate massive vote updates as a GoldenTicket
javascript:function createManualVoteFields(){$("#tableMyVotes tr").each((a,b)=>{$(b).find("td:eq(0)").append($("<input type='number' class='manualVote' size='1' style='width: 35px' />"))}),$("h3:eq(1)").append("&nbsp;&nbsp;<button class=\"btn btn-sm btn-primary\" onclick=\"submitManualVotes()\">Submit manual votes</button>")}function getVotes(){return $("#tableMyVotes tr").map((a,b)=>{return{id:$(b).find("td:eq(1) a").text(),score:+$(b).find("td:eq(0) button:eq(0)").text(),newScore:+$(b).find("td:eq(0) :input.manualVote").val(),title:$(b).find("td:eq(2)").text().trim(),track:$(b).find("td:eq(3)").text().trim()}}).filter((a,b)=>b.id)}function showCurrentVotesStats(){var a=getVotes(),b={votesPerScore:{},votesPerTrackThenScore:{},votesPerTrack:{}};$.each(a,function(d,e){b.votesPerScore[e.score]=b.votesPerScore[e.score]||[],b.votesPerTrack[e.track]=b.votesPerTrack[e.track]||[],b.votesPerTrackThenScore[e.track]=b.votesPerTrackThenScore[e.track]||{},b.votesPerTrackThenScore[e.track][e.score]=b.votesPerTrackThenSco
@fcamblor
fcamblor / background.png
Last active November 8, 2017 11:59
4sh_loterie
background.png
@fcamblor
fcamblor / first-restx-release.md
Last active December 21, 2017 08:09
First maven restx release on maven central

Create a keybase.io account

Download keybase.io public key by clicking on your profile page and on the key

Paste public key content in /tmp/keybase-public.key

You can publish it as well on http://pgp.mit.edu/ (not sure if this step is mandatory or not .. I did it so cannot check if without it it doesn't work :-))

Download keybase.io private key by clicking on your profile page and on the "edit" link

Paste private key content in /tmp/keybase-private.key

@fcamblor
fcamblor / Resources.md
Last active October 13, 2017 08:14
Et si votre backend était une Google Spreadsheet ?

URL pour accéder au contenu JSON d'une Spreadsheet : http://bit.ly/gs-json-url
Enlever la callback pour récupérer du JSON brut (sans JSONP)

============

Créer un menu déroulant additionnel dans la Spreadsheet :

function onOpen() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
@fcamblor
fcamblor / changeOSXScreenCaptureLocation.sh
Created September 7, 2016 10:26
Change OS X Screen capture location
# It could fit in a tweet ... except that twitter considers com.apple..... is an url and is putting extra info in the
# tweet making it longer than 140 chars -_-'
# Note that your target directory must exist prior to setting the config option
# And I `killall SystemUIServer` in order to have config option taken into consideration immediately
mkdir "$HOME/Captures" && defaults write com.apple.screencapture location -string "$HOME/Captures" && killall SystemUIServer
@fcamblor
fcamblor / pokemon-names.json
Last active July 29, 2016 01:39
List of pokemon names in different languages. You can use it this way : pokemon[25].names.fr
[ null, {
"id" : 1,
"names" : {
"de" : "Bisasam",
"en" : "Bulbasaur",
"es" : "Bulbasaur",
"fr" : "Bulbizarre",
"it" : "Bulbasaur",
"ja" : "フシギダネ",
"ko" : "이상해씨",
@fcamblor
fcamblor / DataLoader.js
Last active May 25, 2021 19:14
Resolving promise multiple times
/**
* Utility class allowing to load data from 3 levels :
* - Remote server
* - Browser's Local storage
* - In memory cache
*
* It provides a loadEventsThen(dataAvailableCallback) method which will trigger
* dataAvailableCallback once data will be retrieved at some point
* The first time it is called, in-memory cache will be empty (thus, callback will never be called on it)
*/
@fcamblor
fcamblor / fill-trello-with-schedule.js
Last active August 28, 2017 21:20
fill-trello-with-schedule.js
/**
* SETUP :
* - First, you need to open a Trello board where will be imported your schedule. You will need to fill your trello board
* with initial "List" containers (named as you want, the important thing is to note the index of the list in your board).
* - You will need to install the "Card color titles for trello" chrome extension
* (available here https://chrome.google.com/webstore/detail/card-color-titles-for-tre/hpmobkglehhleflhaefmfajhbdnjmgim)
* in order to nicely display your card's labels title instead of only the label's color
* - Update the DEFAULT_CARD_COMPOSER code below to match different possible talks' talkType attribute, and provide the index
* of the list (0-based) you want to put the talk into + a color which will be representing this talk type
* For instance, in example below, Hand's on Labs talks will fill the *first list* of your trello board (I suppose you will
@fcamblor
fcamblor / Solarized Dark.itermcolors
Last active March 10, 2016 10:24
install-mbp-extract.sh
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
@fcamblor
fcamblor / MyExecutors.java
Created January 15, 2016 12:48
Generics in enums
public class MyExecutors<R> {
public static final MyExecutors<FooTask> foosTasks = new MyExecutors(Executors.newSingleThreadExecutor());
public static final MyExecutors<BarTask> barsTasks = new MyExecutors(Executors.newFixedThreadPool(10));
public static final MyExecutors<QuixTask> quixTasks = new MyExecutors(Executors.newFixedThreadPool(30));
private static final List<MyExecutors> VALUES = new ArrayList<>();
private ExecutorService executorService;
MyExecutors(ExecutorService executorService) {
VALUES.add(this);