This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php5 | |
<?php | |
/* Very Simple Google Translate REST client | |
* Created on march 19th 2011 ronan.guilloux | |
* @author ronan.guilloux | |
* @license http://www.gnu.org/licenses/agpl.txt GNU AFFERO GPL v3 | |
* @version 1.0 | |
*/ | |
// API Key available here : https://code.google.com/apis/console/, for dev purpose only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
PS1="$GREEN\u@\h$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function _inihash () { | |
# private function | |
# call at the beginning of each procedure | |
# defines: _keys _values _ptr | |
# | |
# Usage: _inihash NAME | |
local name=$1 | |
_keys=_${name}_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source : http://goo.gl/ySY1w | |
if (typeof console == "undefined") { | |
window.console = { | |
log: function () {} | |
}; | |
} | |
// variant : Disabling any console.log, the --force mode : | |
window.console = { | |
log: function () {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remote svn sever: root@remote | |
ssh root@remote | |
svnadmin create /home/svn/NewName | |
svnadmin dump /home/svn/OldName > OldName.dump | |
svnadmin load /home/svn/NewName < OldName.dump | |
rm /home/svn/OldName/ -rf | |
rm OldName.dump | |
exit | |
# Local copy: me@local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir log | |
touch log/.gitkeep | |
git add log/.gitkeep | |
echo "log/*" >> .gitignore | |
git add .gitignore | |
git ci -m "Added empty log/ folder" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source : http://goo.gl/bJmRv, augmented with a little checkboxes handler | |
$.fn.extractObject = function() { | |
var accum = {}; | |
function add(accum, namev, value) { | |
if (namev.length == 1) | |
accum[namev[0]] = value; | |
else { | |
if (accum[namev[0]] == null) | |
accum[namev[0]] = {}; | |
add(accum[namev[0]], namev.slice(1), value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// place this 'PHP.sublime-build' file in ~/.config/sublime-text-2/Packages/User/ | |
{ | |
"cmd": ["/usr/bin/php", "-l", "$file"], | |
"selector": "source.php", | |
"file_regex": "^Parse error: .* in (.*?) on line ([0-9]*)" | |
} | |
// Then restart ST2 & type 'CTRL+B' to use it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PHP version validation */ | |
// source: https://github.com/magento/magento2/blob/master/app/bootstrap.php | |
if (version_compare(phpversion(), '5.3.0', '<') === true) { | |
if (PHP_SAPI == 'cli') { | |
echo 'Magento supports PHP 5.3.0 or newer. Please read http://www.magento.com/install.'; | |
} else { | |
echo <<<HTML | |
<div style="font:12px/1.35em arial, helvetica, sans-serif;"> | |
<div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"> | |
<h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh myGitServer | |
cd ~/repositories | |
mkdir myproject.git | |
cd myproject.git/ | |
git init —bare | |
git update-server-info |
OlderNewer