Skip to content

Instantly share code, notes, and snippets.

View SebastienElet's full-sized avatar
🏠
Working from home

Sébastien ELET SebastienElet

🏠
Working from home
View GitHub Profile
@lukaszkorecki
lukaszkorecki / vim-ruby-listchars-spaces.vim
Created December 27, 2010 15:14
Shows softabs (spaces instead of tabs) as real tabs, but still saves spaces. I don't get it. Don't worry - neither do I.
" shows expanded tabs (2 spaces) using
" vim's listchars (which only work with
" hard tabs) but still saves spaces instead of tabs
" needds following settings:
" set softtabstop=2
" set shiftwidth=2
" set tabstop=2
" set expandtab
" set list
" set listchars=tab:▸\ ,eol:.
@funkatron
funkatron / http_digest_example.php
Created April 30, 2011 20:08
An example of how to manually construct an HTTP Digest authentication header.
<?php
$url = 'http://domain.foo';
$uri = '/assets';
$username = 'testyser';
$password = 'somepassword';
$method = 'GET';
$ht = new HttpRequest($url.$uri, HttpRequest::METH_GET);
$ht->send();
@aeurielesn
aeurielesn / util.php
Created July 31, 2011 03:47
Decode Unicode strings in PHP
<?php
#source: http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char
function replace_unicode_escape_sequence($match) {
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
}
function unicode_decode($str) {
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str);
}
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@trevordixon
trevordixon / xlsxParser.js
Created August 17, 2012 04:10
Parse an Excel xlsx file with javascript, jquery, and zip.js
/*
Relies on jQuery, underscore.js, Async.js (https://github.com/caolan/async), and zip.js (http://gildas-lormeau.github.com/zip.js).
Tested only in Chrome on OS X.
Call xlsxParser.parse(file) where file is an instance of File. For example (untested):
document.ondrop = function(e) {
var file = e.dataTransfer.files[0];
excelParser.parse(file).then(function(data) {
console.log(data);
@gfreezy
gfreezy / .slate.js
Last active November 18, 2021 16:13
slate configuration
var pushRight = slate.operation("push", {
"direction": "right",
"style": "bar-resize:screenSizeX/2"
});
var pushLeft = slate.operation("push", {
"direction": "left",
"style": "bar-resize:screenSizeX/2"
});
@miguelmota
miguelmota / README.md
Last active May 25, 2024 13:23
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@maxim
maxim / tasks.yml
Last active June 15, 2016 03:41
Copy file on remote machine in ansible
- name: ensure file exists at path
shell: rsync -ci /source/path /destination/path
register: rsync_result
changed_when: "rsync_result.stdout != ''"
@jubianchi
jubianchi / infra.md
Last active August 29, 2015 14:04
infra

Comment je suis passé d'un serveur dédié monolithique à une archi. basée sur la virtu, découpée, isolée, automatisée, monitorée, ...

TLDR : Je suis reparti from scratch en utilisant toute l'expèrience acquise pendant la maintenance de mon serveur précédent et j'ai utiliser des outils modernes de virtualisation, de containerisation, de configuration et d'orchestration (ça fait beaucoup de "ion") afin d'avoir une infrastructure solide et souple.

Avant

En 2006, j'ai commandé mon premier serveur dédié chez Dedibox. A l'époque, je débutais en administration système et les seuls serveurs que j'avais utilisés jusque là étaient des petits mutualisés. Bien sur, j'avais travaillésur des serveurs dédiés maintenus par les administrateurs au boulot mais je n'avais jamais fait tout cela seul, sur mes propres serveurs.

Déjà à cette époque, je me disais qu'être développeur web impliquait obligatoirement de connaître les problèmatiques système sous-jacentes. Je pense qu'il est impossible de produire une application co