Skip to content

Instantly share code, notes, and snippets.

@kbsali
kbsali / partial.bash_rc
Created February 14, 2012 10:34
Colorize bash prompt + include current git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/-(git\/ \1 )/'
}
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
force_color_prompt=yes
@kbsali
kbsali / ScriptHandler.php
Last active December 16, 2015 13:29
Updates the value of ICU_DATA_VERSION to '4.2' if needed
<?php
namespace YourBundle\Composer;
class ScriptHandler
{
public static function updateIcuVersion($event)
{
if (false === self::isCentos()) {
return;
@kbsali
kbsali / boostrap-inline-hidden.css
Created September 30, 2013 15:38
Simply adds "hidden-inline-[xs|sm|md|lg] classes to bootstrap 3 (see https://github.com/twbs/bootstrap/issues/8869)
.hidden-inline-xs {
display: inline !important;
}
tr.hidden-inline-xs {
display: table-row !important;
}
th.hidden-inline-xs,
td.hidden-inline-xs {
@kbsali
kbsali / starter-template.html
Created October 11, 2013 14:47
This is the basic starter template proposed on getbootstrap's page http://getbootstrap.com/examples/starter-template/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../assets/ico/favicon.png">
@kbsali
kbsali / starter-template.jade
Last active December 25, 2015 06:59
Here is the Jade (http://jade-lang.com/) version of bootstrap's starter-template sample page
!!!
html
head
meta(charset="utf-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(name="description", content="")
meta(name="author", content="")
title Starter Template for Bootstrap
link(rel="stylesheet", type="text/css", href="/css/main.css")
//[if lt IE 9]
@kbsali
kbsali / sticky-footer-navbar.jade
Last active March 7, 2016 23:23
Here is the Jade (http://jade-lang.com/) version of bootstrap's "sticky-footer-navbar" sample page
@kbsali
kbsali / mysql-innodb-bulk-inserts.sql
Last active August 23, 2017 15:09
Mysql InnoDB + MyIsam bulk insert statements
LOCK TABLES `table_name` WRITE;
SET autocommit=0;
SET foreign_key_checks=0;
SET unique_checks=0;
/*....
INSERT ... ON DUPLICATE KEY UPDATE
INSERT IGNORE INTO
....*/
@kbsali
kbsali / BlablaAdmin.php
Created April 22, 2014 14:56
Disable soft DoctrineExtensions' SoftDeleteable in Sonata Admin list view
<?php
...
class BlablaAdmin extends Admin
{
...
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
$em = $query->getQueryBuilder()->getEntityManager();
[PSR-0]
psr0
[PSR-1]
encoding
short_tag
[PSR-2]
braces
elseif