Skip to content

Instantly share code, notes, and snippets.

View MarceauKa's full-sized avatar
πŸš€
Working hard!

Marceau Casals MarceauKa

πŸš€
Working hard!
View GitHub Profile
@jpcaruana
jpcaruana / .vimrc
Created April 1, 2011 09:21
ma conf vi
" This must be first, because it changes other options as side effect
set nocompatible
" coloration syntaxique
syn on
" met les buffer en arriere plan plutot que de les fermer
set hidden
"DΓ©tection du type de fichier pour l'indentation
@dedy-purwanto
dedy-purwanto / 10fastfinger_bot.js
Created December 22, 2011 12:44
BOT for 10fastfingers, automatic typing with adjustable speed
/*
* BOT for 10fastfingers, automatic typing with adjustable speed
* ================================================================
*
* bored in my apartment and decided to hack this game: http://indonesian-speedtest.10fastfingers.com/
* just start the game, when you're ready to type, DON'T TYPE ANYTHING, open up
* your Developer Tools in Chrome (CTRL+SHIFT+J) and click Console tab, and
* then paste the whole code below, then press enter, and enjoy the show.
*
* twitter.com/kecebongsoft
@betweenbrain
betweenbrain / gist:2284129
Created April 2, 2012 14:56
Git command to export only changed files between two commits
git archive --output=file.zip HEAD $(git diff --name-only SHA1 SHA2)
@nrk
nrk / command.txt
Created April 2, 2012 19:19
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"
@ancestral
ancestral / ASCII JS Keyboard Map
Created July 6, 2012 04:33
ASCII keyboard map for JavaScript keycodes (Mac)
/*
* JavaScript Keyboard Map (Mac layout)
*
*
* escβ€”β€” F1β€”β€”β€” F2β€”β€”β€” F3β€”β€”β€” F4β€”β€”β€” F5β€”β€”β€” F6β€”β€”β€” F7β€”β€”β€” F8β€”β€”β€” F9β€”β€”β€” F10β€”β€” F11β€”β€” F12β€”β€” F13β€”β€”β€”β€”β€”+
* | 27 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | ??? |
* ` β€”β€”β€” 1β€”β€”β€”β€” 2β€”β€”β€”β€” 3β€”β€”β€”β€” 4β€”β€”β€”β€” 5β€”β€”β€”β€” 6β€”β€”β€”β€” 7β€”β€”β€”β€” 8β€”β€”β€”β€” 9β€”β€”β€”β€” 0β€”β€”β€”β€” - β€”β€”β€” = β€”β€”β€” deleteβ€”β€”+
* | 192 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
* tabβ€”β€”β€”β€” Qβ€”β€”β€”β€” Wβ€”β€”β€”β€” Eβ€”β€”β€”β€” Rβ€”β€”β€”β€” Tβ€”β€”β€”β€” Yβ€”β€”β€”β€” Uβ€”β€”β€”β€” Iβ€”β€”β€”β€” Oβ€”β€”β€”β€” Pβ€”β€”β€”β€” [ β€”β€”β€” ] β€”β€”β€” \ β€”β€”β€”β€”+
* | 9 | 81 | 87 | 69 | 82 | 84 | 89 | 85 | 73 | 79 | 80 | 219 | 221 | 220 |
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
<?php
// Set these dependant on your BB credentials
$username = 'username';
$password = 'password';
$branch = 'master';
// FTP Credentials
@floptwo
floptwo / php-cli_ovh_mutu.md
Last active January 28, 2025 13:25
OVH PHP-CLI

PHP-CLI (PHP en ligne de commande) sur les hΓ©bergements mutualisΓ©s OVH

More complete info here http://cluster015.ovh.net/infos/ (thanks to @42antoine)

(cli)

/usr/local/php5.3/bin/php => PHP 5.3.29 (cli) (built: Nov 21 2017 08:55:07)
/usr/local/php5.4/bin/php => PHP 5.4.45 (cli) (built: Nov 21 2017 08:35:51)
/usr/local/php5.5/bin/php => PHP 5.5.38 (cli) (built: Nov 21 2017 08:46:45)
@danharper
danharper / a.md
Last active September 2, 2020 17:13
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

@liunian
liunian / gist:9338301
Last active January 7, 2025 11:59
Human Readable File Size with PHP
<?php
# http://jeffreysambells.com/2012/10/25/human-readable-filesize-php
function human_filesize($bytes, $decimals = 2) {
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
}
echo human_filesize(filesize('example.zip'));