Skip to content

Instantly share code, notes, and snippets.

View AlexandreBonneau's full-sized avatar

Alexandre AlexandreBonneau

  • Earth
View GitHub Profile
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@schtobia
schtobia / tschroot
Last active March 22, 2024 18:13
Mount /tmp, /dev/pts, /dev/shm and /proc into chroot and change into chroot
#! /bin/sh
[ ! -d "$1" ] && echo "$1 is not a valid directory." && exit 1;
trap "umount \"${1}\"/tmp \"${1}\"/dev/null \"${1}\"/dev/pts \"${1}\"/dev/random \"${1}\"/dev/shm \"${1}\"/dev/urandom \"${1}\"/proc" EXIT INT TERM HUP PIPE &&
mount --bind /tmp "${1}/tmp" && \
mount --bind /dev/null "${1}/dev/null" && \
mount --bind /dev/pts "${1}/dev/pts" && \
mount --bind /dev/random "${1}/dev/random" && \
mount --bind /dev/shm "${1}/dev/shm" && \
mount --bind /dev/urandom "${1}/dev/urandom" && \
mount --bind /proc "${1}/proc" && \
@ksrb
ksrb / index.ejs
Last active March 10, 2021 05:58
jquery.inputmask webpack configuration and package.json
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<input id="float"/>
</body>
</html>
@joelgombin
joelgombin / reponse.txt
Last active January 25, 2017 01:07
Réponse aux mails de sollicitations des "Editions européennes universitaires"
Bonjour,
merci de vos relances insistantes mais votre proposition ne m'intéresse pas. [Mon mémoire|ma thèse] est disponible en ligne librement [mettre lien vers HAL-SHS ou autre], qui veut le lire le peut gratuitement. Et celui qui en souhaite une version papier l'imprimera à ses propres frais pour bien moins cher que ce que vous vendriez le livre. L'université crève des "éditeurs" qui captent de manière indue la valeur créée par les universitaires... et rachetée par les universités. N'ajoutez pas le harcèlement à l'immoralité de ce mode de fonctionnement reposant sur la spoliation et la prédation.
Je profite de ce message pour vous faire part de la désapprobation unanime de nos professions à l'égard de vos tentatives d'hameçonnage de la recherche publique. Mais, compte tenu de la veille intensive que vous semblez pratiquer, vous ne pouvez l'ignorer !
Je vous remercie donc de ne plus me relancer et de bien vouloir retirer mes coordonnées de vos bases de données.
Vous en remerciant d'avance,
@AlexandreBonneau
AlexandreBonneau / CdzAutoNumeric.js
Created November 8, 2016 00:03
Directive cdz-auto-numeric : wrap an autoNumeric-managed input with Vue.js 2.0
//AutoNumeric 2 : https://rawgithub.com/BobKnothe/autoNumeric/master/autoNumeric-2.0/autoNumeric-2.0-BETA.js //FAIL
//AutoNumeric 1.9.46 : https://cdnjs.cloudflare.com/ajax/libs/autonumeric/1.9.46/autoNumeric.min.js //WORK
//Live example on http://codepen.io/AnotherLinuxUser/pen/VmwvOK
let cdzNumericDirective = {
//Known problems :
//Using __autoNumercic 2.0 BETA__, when using 2 inputs with the same v-model (or when one input updates the value of another, even with different v-models), when you enter a value in one input, both updates well, but when you focus on the second input, the initial value is shown (since the current autoNumeric 2.0 BETA keeps its own `rawValue`). You can solve this by using 1.9.46 for the time being.
bind(el, bindings, vnode, oldVnode) {
let jQueryElement = $(el);
@ljharb
ljharb / array_iteration_thoughts.md
Last active May 22, 2024 09:22
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active June 11, 2024 10:46
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active July 2, 2024 21:29
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com