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 / css_general_1.css
Created September 24, 2012 13:44
general 1
/* -- BAD -- */
#identifier {
key: value;
}
#identifier{
key:value;
}
#identifier
@rob-bar
rob-bar / css_general_2.css
Created September 25, 2012 14:24
indenting whitelines and zombielines
/* -- BAD -- */
#identifier {
key: value;
#anotheridentifier {
key: value;
}
}
#identifier {
key: value;
@rob-bar
rob-bar / css_general_3.css
Created September 25, 2012 15:07
Commenting, shorthand css and function calls:
/* -- COMMENTING -- */
/* -- 1linecomment -- */ or /* comment */
/* =============================================================================
sectionname
========================================================================== */
/* -- SHORT HAND CSS -- */
/* -- BAD -- */
@rob-bar
rob-bar / css_bestp_1.css
Last active October 11, 2015 01:38
less variable names, mixins and ordening
/* -- LESS VARIABLE NAMES -- */
@color_red: #F00;
@color_green: #0F0;
/* -- LESS MIXINS -- */
.ownmixin(@par: 10px) {
margin: 2px @par;
}
/* -- SUGESTED ORDENING -- */
@rob-bar
rob-bar / uri_parameters.js
Last active October 12, 2015 18:48
#snippet #javascript #function uri_parameters()
function uri_parameters(){
var prmstr = window.location.search.substr(1);
var prmarr = prmstr.split ("&");
var params = {};
for ( var i = 0; i < prmarr.length; i++) {
var tmparr = prmarr[i].split("=");
params[tmparr[0]] = tmparr[1];
}
return params;
@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'))) {
@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 / 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 / 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 / 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',