Skip to content

Instantly share code, notes, and snippets.

function ESLintFix()
silent execute "!./node_modules/.bin/eslint --fix %"
edit! %
Neomake
endfunction
nnoremap <leader><leader> :call ESLintFix()<CR>
@jamesflorentino
jamesflorentino / convert.sh
Last active September 20, 2016 10:54
Makefile for creating favicons from 16x16 up to 128x128.
convert favicon.png -resize 16x16 favicon.ico;
convert favicon.png -resize 16x16 favicon_16x16.png;
convert favicon.png -resize 32x32 favicon_32x32.png;
convert favicon.png -resize 64x64 favicon_64x64.png;
convert favicon.png -resize 128x128 favicon_128x128.png;
echo "conversion complete";
@jamesflorentino
jamesflorentino / GIF-Screencast-OSX.md
Created July 14, 2016 21:17 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

App = Ember.Application.create();
App.Router.map(function() {
this.route('post', { path: '/:post_id' });
});
posts = [{
id: 0,
title: "Rails is omakase",
body: "There are lots of à la carte software environments in this world."
var App = Ember.Application.create();
App.ApplicationController = Ember.Controller.extend({
bag: ['Protein Shake', 'Training Shoes', 'Steroids', 'Insulin Shots'],
home: [],
actions: {
leaveAtHome: function(items) {
items.forEach(function(item) {
this.get('bag').removeObject(item);
this.get('home').addObject(item);
@jamesflorentino
jamesflorentino / compare.js
Created August 18, 2013 04:11
Bato bato pik
function compare(choice1, choice2) {
if (choice1 === choice2) {
return 'Result is a tie';
} else if (choice1 === 'rock') {
if (choice2 === 'scissors') {
return 'Rock wins';
} else if (choice2 === 'paper') {
return 'Paper wins';
}
} else if (choice1 === 'paper') {
var _dictionary = {
'rock,scissors': 'Rock',
'rock,paper': 'Paper',
'scissors,paper': 'Scissors'
};
function compare(a, b) {
var result;
if (a === b) {
result = 'Result is a tie';
@jamesflorentino
jamesflorentino / client.js
Last active December 20, 2015 14:49
client.js
/** client.js **/
var https = require('https');
var url = require('url');
function Client() {}
/**
* All initialization code should be here.
*/
Client.prototype.initialize = function() {};
//To get the GPS coordinate from the mobile browser:
navigator.geolocation.getCurrentPosition(function(location) {
// location.coords.longitude;
// location.coords.latitude;
});
//To let the server receive data, you'll need to create a service that will handle your json data.
//e.g. in node.js/express
// Basic entity-component closure
function Component(api) {
return function(entity) {
for(var key in api) {
if (api.hasOwnProperty(key)) {
entity[key] = api[key];
}
}
}
}