Skip to content

Instantly share code, notes, and snippets.

View sherbrow's full-sized avatar

Jonathan Lopes sherbrow

View GitHub Profile
@sherbrow
sherbrow / dropdown-btn.css
Created July 2, 2012 19:38
Twitter-bootstrap add-on to create dropdowns in button groups (like http://jsfiddle.net/Sherbrow/3R3EV/6/ )
.dropdown-btn {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
padding: 4px 10px 4px;
margin-bottom: 0;
font-size: 13px;
@sherbrow
sherbrow / bootstrap.fluid-grid-offsets.css
Created August 1, 2012 20:32
Twitter Bootstrap - Fluid grid offsets
/* Generated with default variables */
.row-fluid .offset12 {
margin-left: 104.25531913799999%;
*margin-left: 104.20212764863828%;
}
.row-fluid .offset12:first-child {
margin-left: 102.127659564%;
*margin-left: 102.07446807463829%;
@sherbrow
sherbrow / youtube-user.js
Created August 14, 2013 14:42
Get youtube user stats : here, we get the total view count of some user Needs a lot of improvements
/**
* Requires jQuery (will fallback)
* Can take advantage of `numeral()` https://github.com/adamwdraper/Numeral-js
*/
// Dependencies
/*
if(typeof jQuery === 'undefined') {
var elt = document.createElement('script');
elt.src = 'http://code.jquery.com/jquery.min.js';
@sherbrow
sherbrow / html_build_form.php
Last active August 29, 2015 14:26
Form hidden fields equivalent of http_build_query
/**
* First draft of sister function http_build_query http://php.net/manual/function.http-build-query.php
* intended to generate hidden form inputs from the *same* arguments
*/
function html_build_form(array $array, $prefix = '') {
$str = '';
foreach($array as $key => $val) {
$name = $prefix?$prefix.'['.$key.']':$key;
@sherbrow
sherbrow / myclass.php
Last active January 23, 2016 15:31
Ultimate PHP v5 class declaration aka the simplest most complex class definition in PHP
<?php
/* Ultimate PHP v5 class declaration */
/** TODO
* - interfaces http://php.net/manual/language.oop5.interfaces.php
* - abstract http://php.net/manual/language.oop5.abstract.php
* - traits http://php.net/manual/language.oop5.traits.php
* - magic methods http://php.net/manual/language.oop5.magic.php
*/
@sherbrow
sherbrow / .env
Created February 19, 2017 20:13
Lumen 5.4 subfolder install
BASE_URL=/subfolder
@sherbrow
sherbrow / post-receive
Created February 19, 2017 20:29
post-receive deploy hook
#!/bin/sh
DEPLOY_TO=/var/www/labs.sherbrow.fr/
BRANCH=master
git --work-tree=$DEPLOY_TO --git-dir=./ checkout $BRANCH -f || exit 1
echo "Deploying to "$DEPLOY_TO" ("$BRANCH")" || exit 2
composer install -d $DEPLOY_TO --quiet --no-dev
@sherbrow
sherbrow / MonaServer.ini
Last active April 27, 2021 16:12
MonaServer Debian 10 install
;MonaServer.ini
;host = <HOST>:1935
socketBufferSize = 114688
[application]
dir = /usr/local/MonaServer/apps/
[servers]
; targets =
[RTMFP]
port = 1985
keepAlivePeer = 10