Skip to content

Instantly share code, notes, and snippets.

View evanjmg's full-sized avatar
👨‍💻
actively contributing

Evan Gillogley evanjmg

👨‍💻
actively contributing
View GitHub Profile
@alexpchin
alexpchin / Sublime_3_Keyboard_Shortcuts.md
Created March 15, 2015 19:41
Sublime 3 Keyboard Shortcuts
Keypress Action
cmd + s save changes in current file - DO IT OFTEN!!!
cmd + q close Sublime
cmd + w close one file at a time
cmd + alt + arrow switch between files
cmd + numbers also switch between specific files
cmd + f search in you current file
cmd + shift + f search the entire project
cmd + d go to next searched word in file
define(['angular', 'masonry', 'imagesLoaded', 'lodash'], function(angular, Masonry, imagesLoaded, _){
'use strict';
/**
* Masonry Directive for a wall of item.
* This directive is intended to be used along with ng-repeat directive.
* Put masonryWallDir on the container element and pass in a class selector for each item to be laid out.
* Pass in optional options via masonryWallOptions.
* Put the masonryItemDir next to ng-repeat directive on the item to be repeated.
@evanjmg
evanjmg / .block
Last active February 19, 2017 16:43
Drag, Pan, Snap To Grid example
license: gpl-3.0
@robianmcd
robianmcd / license
Last active August 14, 2018 02:41
Polyfill ES6 Promise in Angular 1.3+
var app = angular.module('myApp');
app.run(['$q', '$window', function($q, $window) {
$window.Promise = function(executor) {
return $q(executor);
};
$window.Promise.all = $q.all.bind($q);
$window.Promise.reject = $q.reject.bind($q);
$window.Promise.resolve = $q.when.bind($q);
@timwco
timwco / instructions.md
Last active September 29, 2018 00:23
How to use Bourbon, Neat, Bitters and Refills in a Yeoman app with Bower.

Your bower_components folder should be outside of your /app folder. Otherwise you'll need to modify the paths below.

  • Scaffold your Yeoman App
  • Install Bourbon, Neat & Bitters
    • bower install bourbon
    • bower install neat
    • bower install bitters
  • In your app/stylesheets/main.scss include the assets in this order
@import '../../bower_components/bourbon/dist/bourbon';
@nealrs
nealrs / giphy.js
Created May 5, 2014 21:32
use the giphy api to search for & add an animated gif to a webpage.
// on page load, search for & display a random gif matching your search term using the Giphy API.
// usage:
// include giphy.js in your <head>
// set q to your search term (e.g. "brunch")
// add <span id = "giphyme"></span> wherever you want to display the image. -- FYI, it will be centered.
// big ups to the Giphy crew (giphy.com)
// 2014 - Neal Shyam [@nealrs | nealshyam.com]
document.addEventListener('DOMContentLoaded', function () {
q = "finger guns"; // search query
@victorb
victorb / app.js
Created September 24, 2013 16:37
Easy AngularJS Directive for Google Places Autocomplete
var myApp = angular.module('myApp', []);
myApp.directive('googleplace', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, model) {
var options = {
types: [],
componentRestrictions: {}
};
@greypants
greypants / timeBasedAnimationPattern.js
Created September 17, 2012 18:48
JS: Time-based animation pattern
// Full Blog Post: http://viget.com/extend/time-based-animation
// requestAnimationFrame() polyfill: https://gist.github.com/1579671
window.APP = window.APP || {};
APP.pause = function() {
window.cancelAnimationFrame(APP.core.animationFrame);
};
APP.play = function() {
@eveningkid
eveningkid / how-to-use-react-intl.md
Created July 28, 2017 16:33
How To Use React-Intl: internationalize your React app

How To Use React-Intl: internationalize your React app

This short tutorial assumes you know about ES6 syntax.

Get started

yarn add react-intl or npm i --save react-intl.

Create a messages file

This file should contain every message for your app.
It has an object of (locale, messages) couples:

@mayoff
mayoff / makeAnimatedGif.m
Created February 16, 2013 23:00
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);