Skip to content

Instantly share code, notes, and snippets.

View ninjasort's full-sized avatar
💻
Working remotely

Cameron ninjasort

💻
Working remotely
  • San Francisco, CA
  • 01:08 (UTC -07:00)
View GitHub Profile
@ninjasort
ninjasort / moment-timezone-data.js
Created March 27, 2014 16:07
Add to lib/moment-timezone/tz
moment.tz.add({
"zones": {
"Africa/Abidjan": [
"-0:16:8 - LMT 1912 -0:16:8",
"0 - GMT"
],
"Africa/Accra": [
"-0:0:52 - LMT 1918 -0:0:52",
"0 Ghana %s"
],
@ninjasort
ninjasort / countries.json
Created April 28, 2014 20:44
List of countries
[{
"name": "Afghanistan",
"code": "AF"
}, {
"name": "Åland Islands",
"code": "AX"
}, {
"name": "Albania",
"code": "AL"
}, {
@ninjasort
ninjasort / gist:34331bc231cc87eb8138
Created May 12, 2014 19:13
Facebook, Google Borders
// Facebook Border
.facebook-border {
border: 1px solid;
border-color: #e5e6e9 #dfe0e4 #d0d1d5;
}
// Google Border
.google-border {
border: 1px solid #d8d8d8;
border-bottom-width: 2px;
@ninjasort
ninjasort / mixins.scss
Last active August 29, 2015 14:02
SASS Mixins
// Appearance
// Default styling to form elements
@mixin appearance ($value) {
-webkit-appearance: $value;
-moz-appearance: $value;
appearance: $value;
}
@mixin arrow($direction: up, $size: 5px, $color: #444) {
width: 0;
@ninjasort
ninjasort / aq.js
Last active August 29, 2015 14:02
Async Function Queueing
var _aq = [],
funcs = [function () {
console.log('Handler 1 executed.');
}, function () {
console.log('Handler 2 executed.');
}];
_aq.push(funcs);
(function() {
@ninjasort
ninjasort / _cs-dob.html
Last active August 29, 2015 14:02
CrowdSurge Date of Birth Directive
<ng-form name="date_of_birth" class="form-inline cs-dob" ng-class="{'has-error': date_of_birth.$invalid && submitted}">
<div class="form-group">
<select name="month" class="form-control" ng-model="dob.month" ng-options="n for n in [] | range:1:12" required>
<option value="">MM</option>
</select>
</div>
<div class="form-group">
<select name="day" class="form-control" ng-model="dob.day" ng-options="n for n in [] | range:1:31" required>
<option value="">DD</option>
</select>
@ninjasort
ninjasort / jp.js
Created June 24, 2014 04:17
JP Directive
'use strict';
angular.module('judasPriest.directives')
.directive('judasPriest', ['$window',
function ($window) {
return {
restrict: 'C',
link: function (scope, el, attrs) {
// canvas els
@ninjasort
ninjasort / sass-toolbox.scss
Created September 6, 2014 04:18
sass-toolbox
/*
* Sass Toolbox
* A useful collection of Sass functions and mixins
* http://zerosixthree.se/8-sass-mixins-you-must-have-in-your-toolbox/
*/
// rem font-size with pixel fallback
@function calculateRem($size) {
$remSize: $size / 16px;
@return $remSize * 1rem;
@ninjasort
ninjasort / package.json
Created September 6, 2014 17:59
Gulp Stack
{
"devDependencies": {
"gulp-sass": "latest",
"gulp-uglify": "latest",
"gulp-coffee": "latest",
"gulp-concat": "latest",
"gulp-connect": "latest",
"gulp-livereload": "latest",
"gulp-util": "latest",
"node-bourbon": "latest",
@ninjasort
ninjasort / jquery-hover-feedback.js
Last active August 29, 2015 14:06
jquery hover feedback fix
/*
<div class="box"></div>
When hovering over this simple box div, the class "big" will be added to the box.
It will be animated over 300ms with a easeInOutQuint easing function. The problem
occurs when you quickly mouse in and out of the element. It will continue to build up
animations in a queue. To stop the queue, we must pass a complete callback that will
fire after a single animation has been run. When it finally does end, the existing queue
of animations on the element will be stopped, and the last animation will play one last time,
as a final animation. Passing false as the first argument will keep the animation queue available