Skip to content

Instantly share code, notes, and snippets.

View ralphcrisostomo's full-sized avatar

Ralf Crisostomo ralphcrisostomo

  • Goodstuff
  • Australia
View GitHub Profile
@ralphcrisostomo
ralphcrisostomo / gist:2631889
Created May 8, 2012 01:37
backbone fetch supports Jquery.ajax parameters
// Sample Code
// backbone fetch supports Jquery.ajax parameters
Model.fetch( {
data: {api_key: 'secretkey'},
type: 'POST',
success: function(model, response) {
console.log('SUCCESS:');
console.log(response);
@ralphcrisostomo
ralphcrisostomo / gist:3088892
Created July 11, 2012 08:15 — forked from killerbytes/gist:3050623
Javascript: delay
var delay = (function() {
var timer = 0;
return function(callback, ms) {
clearTimeout(timer);
timer = setTimeout(callback, ms);
};
})();
@ralphcrisostomo
ralphcrisostomo / print_object_in_javascript.js
Created July 20, 2012 00:43
Print Objects in Javascript
/**
Print Objects in Javascript
*/
var output = '';
for (property in object) {
output += property + ': ' + object[property]+'; ';
}
console.log(output);
@ralphcrisostomo
ralphcrisostomo / handlebars_with_backbone_collection.js
Created August 14, 2012 09:19
using handlebars with backbone block collection
// Reference:
// http://stackoverflow.com/questions/7344982/questions-on-backbone-js-with-handlebars-js
var ArticleListView = Backbone.View.extend({
el: $('#main'),
render: function(){
var js = this.collection.toJSON();
var template = Handlebars.compile($("#some-template").html());
$(this.el).html(template({articles: js}));
return this;
@ralphcrisostomo
ralphcrisostomo / insetTopShadowOnly.scss
Created August 17, 2012 06:59
Inset, Top Shadow Only
// Inset, Top Shadow Only
@include box-shadow(inset 0 1px 1px -1px black);
@ralphcrisostomo
ralphcrisostomo / flexbox_layout.html
Created August 17, 2012 09:19
The classic 3 column layout. Notice the navigation appearing first, also note that the background colour extends to the full height of all boxes.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>flexbox example - 3 column layout</title>
<meta name="author" content="Gwilym Johnston">
<link rel="stylesheet" href="base.css" type="text/css" media="screen">
<style type="text/css">
.flexbox {
@ralphcrisostomo
ralphcrisostomo / center-element.scss
Created August 17, 2012 10:46
Center an element absolutely and relatively
/**
author: Ralph Crisostomo
*/
@mixin center-element($width, $height) {
width:$width;
height:$height;
position: absolute;
top: 50%;
left: 50%;
@ralphcrisostomo
ralphcrisostomo / stretchToFit.scss
Created August 23, 2012 03:14
stretch to fit on window size
.div {margin:10px; position:absolute; top:0; left:0; right:0; bottom:0}
@ralphcrisostomo
ralphcrisostomo / initial.setup.mac.workflow.md
Last active December 13, 2015 20:38
My Initial Setup for Mac Workflow
@ralphcrisostomo
ralphcrisostomo / .zshrc
Last active December 13, 2015 20:38
My .zshrc file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# ZSH_THEME="robbyrussell"
ZSH_THEME="doubleend"