Skip to content

Instantly share code, notes, and snippets.

View AurelienGasser's full-sized avatar

Aurélien Gasser AurelienGasser

View GitHub Profile
We couldn’t find that file to show.
@AurelienGasser
AurelienGasser / gist:1688410
Created January 27, 2012 11:40
coffee-resque heroku test
var resque = require('./coffee-resque');
process.on('SIGTERM', function() {
console.log('SIGTERM SIGNAL CAUGHT!!!');
process.exit(0)
});
var worker = resque.connect({
host: 'xxx',
port: xxx,
var cars = db.cars.find().toArray();
for (var i in cars) {
var car = cars[i];
car.imageSize = { w: 128, h: 64 }; // faut mettre quoi ici ? :p
/* afficher */
printjson(car);
/* sauvegarder (on peut car _id est present) */
db.cars.save(car)
}
You give a 1-1000 number to each bottle.
You convert that number to binary. The maximum number (1000) takes 10 digits (decimal 1000 == binary 1111101000)
You number each rat 1-10.
For each bottle, you make the Nth rat drink if the bottle's Nth digit is 1.
You see which rats die, and determine the binary code for the poisoned bottle.
e.g.
if rats 2,3,8 die
then bottle 0010000110 is poisoned
i.e. bottle 134 is poisoned
@AurelienGasser
AurelienGasser / pull-all.sh
Created September 19, 2019 20:25
Shell script to pull the current branch in every git repository under the current folder
#!/bin/bash
CUR_DIR=$(pwd)
echo -e "\n\033[1mPulling in latest changes for all repositories...\033[0m"
for i in $(find . -name ".git" | cut -c 3-); do
folder=$(printf '%s\n' "${i//\/.git/}")
# Go to folder
---
# Source: hlf-k8s/charts/ca/templates/secret--ca.yaml
apiVersion: v1
kind: Secret
metadata:
name: network-org-1-peer-1-ca--ca
labels:
app: ca
heritage: "Tiller"
release: "network-org-1-peer-1"
@AurelienGasser
AurelienGasser / linkedin-recruiter.js
Created February 23, 2023 10:04
Auto-expand list of experience items, color items based on duration, strikethrough based on keyboard, hide previously seen candidates.
// LinkedIn recruiter search results highlighter.
// Paste into your browser's JavaScript console.
//
// Features:
// - Auto-expand experience items
// - Color experience items based on duration (red if less than 1 year, green if 2y+, etc)
// - Strike-through experience items containing certain keywords
// - Record profiles already seen in search results and hide them in subsequent searches (to enable, set config variable to true below)
//
// If you make improvements, feel free to reach out and I can merge them. <aurelien.gasser at gmail.com>