Skip to content

Instantly share code, notes, and snippets.

View leongaban's full-sized avatar

Leon Gaban leongaban

View GitHub Profile
@leongaban
leongaban / SassMeister-input.scss
Created March 7, 2014 22:40
SASS mixin for Pixels to EM
// ----
// Sass (v3.3.0.rc.5)
// Compass (v1.0.0.alpha.18)
// ----
/* PIXELS to EM */
// eg. for a relational value of 12px write em(12) when the parent is 16px
// if the parent is another value say 24px write em(12, 24)
// @include em(12);

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@leongaban
leongaban / each loop function to create objects
Last active August 29, 2015 14:04
.each to create Objects (jQuery)
addedPhones = $('.added_phone');
addedPhones.each( function(i) {
var tag = $(this).children("label").text();
var value = $(this).children("input").val();
phoneObjs = $(this).map(function(i,el) {
var $el = $(el);
return {
label: value,
tag: tag
@leongaban
leongaban / _queries.scss
Created November 5, 2014 19:54
Boiler plate for Responsive Media Queries
/* RESPONSIVE MEDIA QUERIES
====================================================
==================================================== */
/* 1600
==================================================== */
@media all and (max-width: 1600px) {
}
/* 1400
@leongaban
leongaban / server.js
Last active August 29, 2015 14:13
server.js routes api
// load the express package and create our app
// CALL THE PACKAGES --------------------
var express = require('express'); // call express
var app = express(); // define our app using express
var bodyParser = require('body-parser'); // get body-parser
var morgan = require('morgan'); // used to see requests
var mongoose = require('mongoose'); // for working w/ our database
var port = process.env.PORT || 8615; // set the port for our app
// BASE SETUP
@leongaban
leongaban / express.sublime-snippet
Created February 18, 2015 16:02
Sublime Text 2 - ExpressJS snippet
<snippet>
<content><![CDATA[
var express = require('express'),
app = express();
app.get('/', function(req, res) {
res.sendfile(__dirname + '/client/views/index.html');
})
app.listen(${1:this}, function() {
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@leongaban
leongaban / sass-buttons.scss
Created March 9, 2015 03:14
SASS buttons using extend
/* Buttons
============================================================
========================================================= */
// button:disabled {
// background: $gray;
// }
%button {
color: #fff;
@leongaban
leongaban / gist:5882b14e9b39a1c623af
Created March 10, 2015 20:03
jQuery : bind unbind click()
// jQuery button click bind
$('').unbind('click').bind('click', function (event) {
});
@leongaban
leongaban / scopeFactory
Created March 24, 2015 01:55
scopeFactory
/*global angular*/
/* =========================================
--------------------------------------------
Save a scope:
var vs = $scope;
ScopeFactory.saveScope('alerts', vs);
Retrieve a scope:
var alertScope = ScopeFactory.getScope('alerts');