Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
" 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:. |
<?php | |
$url = 'http://domain.foo'; | |
$uri = '/assets'; | |
$username = 'testyser'; | |
$password = 'somepassword'; | |
$method = 'GET'; | |
$ht = new HttpRequest($url.$uri, HttpRequest::METH_GET); | |
$ht->send(); |
<?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); | |
} |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
/* | |
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); |
var pushRight = slate.operation("push", { | |
"direction": "right", | |
"style": "bar-resize:screenSizeX/2" | |
}); | |
var pushLeft = slate.operation("push", { | |
"direction": "left", | |
"style": "bar-resize:screenSizeX/2" | |
}); |
Thanks to this article by Christoph Berg
Directories and files
~/
- name: ensure file exists at path | |
shell: rsync -ci /source/path /destination/path | |
register: rsync_result | |
changed_when: "rsync_result.stdout != ''" |
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.
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