Skip to content

Instantly share code, notes, and snippets.

View rob-bar's full-sized avatar

Robbie Bardijn rob-bar

View GitHub Profile
@rob-bar
rob-bar / if.coffee
Last active December 22, 2015 11:09
IF Handlebars helpers
handlebars_helpers: () ->
Handlebars.registerHelper 'ifbool', (b, c) ->
if b then do c.fn else do c.inverse
Handlebars.registerHelper 'ifequal', (l, r, c) ->
if l is r then do c.fn else do c.inverse
Handlebars.registerHelper 'unlessequal', (l, r, c) ->
unless l is r then do c.fn else do c.inverse
@rob-bar
rob-bar / style.sass
Last active December 17, 2015 06:39
#sass #bootstrap #compass
/* ====================================================================================================== */
/* IMPORTS
/* ====================================================================================================== */
//gems
@import "h5bp"
@import "ceaser-easing"
//compass
@import "compass/css3/"
@import "compass/typography/"
@rob-bar
rob-bar / csstransformspreserve3d.coffee
Last active December 16, 2015 10:19
Modernizr csstransformpreserve3D test
# Modernizr.csstransformspreserve3d
Modernizr.addTest 'csstransformspreserve3d', () ->
val = ''
cssText = ''
ret = ''
prop = 'transform-style'
if 'webkitTransformStyle' of document.documentElement.style
prop = '-webkit-' + prop
@rob-bar
rob-bar / cookie.js
Created February 19, 2013 09:33
cookies in javascript
@rob-bar
rob-bar / explode.js
Created January 27, 2013 09:49
#snippet #javascript #function explode(delimiter, string, limit)
function explode (delimiter, string, limit) {
if ( arguments.length < 2 || typeof delimiter == 'undefined' || typeof string == 'undefined' ) return null;
if ( delimiter === '' || delimiter === false || delimiter === null) return false;
if ( typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object'){
return { 0: '' };
}
if ( delimiter === true ) delimiter = '1';
// Here we go...
@rob-bar
rob-bar / db.php
Created January 17, 2013 10:50
#snippet #fuelphp #php #config database settings
<?php
/**
* The development database settings.
*/
return array(
'default' => array(
'type' => 'mysqli',
'connection' => array(
'hostname' => '127.0.0.1',
@rob-bar
rob-bar / st2_md_highl.xml
Last active December 11, 2015 01:29 — forked from lg0/markdown.xml
#snippet #xml #sublimetext2 ST 2 md highlighting
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@rob-bar
rob-bar / shares.php
Last active December 10, 2015 04:58
#snippet #php #view share codes
<?php
// Facebook
echo("http://www.facebook.com/sharer.php?s=100&amp;&p[title]=" . urlencode(TITLE) . "&p[summary]=" .
urlencode(DECRIPTION) . "&p[url]=" . urlencode(URL) . "&t=&v=3&p[images][0]=" . urlencode(IMAGE));
// Linked in
echo("http://www.linkedin.com/shareArticle?mini=true&url" . urlencode(URL) . "=&title" . urlencode(TITLE) . "=&summary=" . urlencode(SUMMARY));
// Twitter
echo("http://twitter.com/home?status=" . urlencode(TWEET));
// Delicious
echo("http://del.icio.us/post?url=" . urlencode(URL));
@rob-bar
rob-bar / .gitignore
Last active October 13, 2015 06:38
#snippet #git Global .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# SVN #
@rob-bar
rob-bar / refactor_created_at_and_updated_at.php
Last active October 12, 2015 19:18
#snippet #fuelphp #php #migration created & updated refactor
<?php
namespace Fuel\Migrations;
class refactor_created_at_and_updated_at {
public function up() {
$tables = \DB::list_tables();
foreach ($tables as $table) {
\Cli::write($table);
if(\DBUtil::field_exists($table, array('created_at', 'updated_at'))) {