Skip to content

Instantly share code, notes, and snippets.

View habovh's full-sized avatar
🦊

Jordan Becker habovh

🦊
View GitHub Profile
@habovh
habovh / di-game rules
Last active April 1, 2016 14:53
Les règles officielles du di-game
# Di-game
> Informations et règles officielles du jeu
## Disclaimer
Le jeu n'a pas été inventé par les auteurs de ces règles, nous n'en réclamons pas la paternité, mais essayons de faire dans l'originalité ainsi que la rigueur, afin de proposer une experience de jeu (de vie ?) unique et excitante !
## Histoire
Prenez 2 bros, mettez-les ensemble dans les mêmes cours, patientez, profitez.
L'idée est venue comme ça, probablement un jour d'ennui profond, allez savoir... Mais on a commencé à jouer à ce jeu très simple en toute innocence. Au fur et à mesure du temps, on a commencé à compter les points, et à jouer de jour en jour, de plus en plus sérieusement. C'est à ce moment là qu'on s'est dit qu'il nous faudrait établir des règles précises pour couvrir tous les cas de conflits ou de doute. Car oui évidemment, il n'y a pas d'arbitre à ce jeu, il faut compter sur l'honnêteté de son adversaire. (On fait dans le social quoi!)
@habovh
habovh / trash.sh
Last active April 3, 2016 03:35
Little trash script for use with OS X. Mimics Finder's behavior when deleting a file that has the same name as a file already present in the trash, with a bonus.
#!/bin/bash
for file in "$@"; do
filename=$(basename "$file")
extension="${filename##*.}"
filename="${filename%.*}"
dest="$HOME/.Trash/$filename.$extension"
if [ -f "$dest" ]; then
@habovh
habovh / angular.filters.nl2br.coffee
Last active July 22, 2016 18:36 — forked from kensnyder/angular.filters.nl2br.js
Safe NL2BR filter for Angular, compatible with linky. Transforms newlines ( \n) into HTML <br /> tags.
# nl2br linky-compatible Angular filter
# CoffeeScript Version (available in JS)
#
# Sample usage in html template:
# "xxx | nl2br"
# <div ng-bind-html=" YourString | nl2br "></div>
angular.module('nl2brFilter', []).filter('nl2br', ['$sanitize', ($sanitize) ->
tag = '<br />'
@habovh
habovh / keybase.md
Created September 6, 2016 14:51
Keybase proof

Keybase proof

I hereby claim:

  • I am habovh on github.
  • I am jordanbecker (https://keybase.io/jordanbecker) on keybase.
  • I have a public key ASDaEsC_mrqBbV97x8jqgA91zPfuFas1ybz1Bt3MZo0Q8Qo

To claim this, I am signing this object:

@habovh
habovh / Wunderground icon names
Created January 13, 2016 17:39
Wunderground icon names returned by the API, in case you handle your own icons that do not have the same name for example.
chanceflurries
chancerain
chancesleet
chancesleet
chancesnow
chancetstorms
chancetstorms
clear
cloudy
flurries
@habovh
habovh / zshrc_Apple_Terminal
Last active April 7, 2021 14:30
ZSH + Apple Terminal: set tab title current working directory for Mojave and earlier
# This is a slightly modified version of Mojave (10.14) script located in /etc/bashrc_Apple_Terminal
# modified to work with zsh.
# It mainly calls update_terminal_cwd when changing the working directory, which prints a special
# invisible string that Apple Terminal interprets and updates the current term title accordingly.
# Note : this script is useless for macOS Catalina and newer versions of macOS, since it should
# already contain at least this functionality.
# Instructions
# Place this file in /etc/ (alongside bash_Apple_Terminal)
@habovh
habovh / cors_support.conf
Last active June 18, 2021 06:48 — forked from agouriou/nginx.conf
Example Nginx (> 1.9) configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs. Handle error status (4xx, 5xx) and expose headers.
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support.conf"
# under your Nginx configuration directory and placing the following
# statement inside your location block(s):
#
# include cors_support.conf;
#
# A limitation to this method is that Nginx doesn't currently send headers
@habovh
habovh / crashdialog
Last active February 6, 2024 07:51
Simple bash script to quickly enable/disable macOS crash reporting dialogs. Tested on macOS Sierra.
#!/bin/bash
# Author: Jordan Becker (https://becker.io/)
if [ $# -lt 1 ]; then
echo "Usage: $0 (on|off|read)"
echo "Lets you quickly enable or disable macOS crash reporting dialogs. Useful for betas ;)"
exit 1
fi
case "$1" in