Skip to content

Instantly share code, notes, and snippets.

View fjcero's full-sized avatar

Francisco Caballero fjcero

View GitHub Profile
@fjcero
fjcero / Gruntfile.js
Last active September 10, 2015 15:57 — forked from nnarhinen/Gruntfile.js
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
@fjcero
fjcero / megaNumber.js
Last active August 29, 2015 14:24 — forked from timgit/megaNumber.js
angular.module('utilsModule').filter("megaNumber", () => {
return (number, fractionSize) => {
if(number === null) return null;
if(number === 0) return "0";
if(!fractionSize || fractionSize < 0)
fractionSize = 1;
var abs = Math.abs(number);
# tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
14:32:33.525122 IP 127.0.0.1.49777 > 127.0.0.1.9200: Flags [P.], seq 313752908:313753888, ack 2465010394, win 257, options [nop,nop,TS val 2684167067 ecr 2684167066], length 980
E...^.@[email protected]#...}L...............
..#...#.GET /index/_search HTTP/1.1
Host: 127.0.0.1:9200
Accept: */*
Content-Length: 845
Content-Type: application/x-www-form-urlencoded
/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/captured_trace.js:478 Unhandled rejection Error: TypeError: Illegal invocation
at Object.ensureErrorObject (/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/util.js:228:20)
at Promise._rejectCallback (/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:416:22)
at Promise._settlePromiseFromHandler (/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:460:17)
at Promise._settlePromiseAt (/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/async.js:177:16)
at Async._drainQueues (/Users/fjcero/project/node_modules/sequelize/node_modules/bluebird/js/main/async.js:187:10)
at Imm

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:

@fjcero
fjcero / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fjcero
fjcero / README.md
Last active August 29, 2015 14:13
PHP Debugging

PHP Debugging

Install

Vagrant

The configuration is already deployed in the local branch in Olapic/Puppet. Just do:

$ cd Environment64; vagrant provision;

Command Name

Description of the command.

Usage

Choose your flavor:

$ php bin/Hermes.php --execute CommandName [--option1="..."] [--option2="..."] [--optionN]

What's this PR do?

Where should the reviewer start?

How should this be manually tested?

Any background context you want to provide?

What are the relevant tickets?

Screenshots (if appropriate)

Questions:

  • Is there a blog post?
  • Does the knowledge base need an update?
  • Does this add new (Python) dependencies which need to be added to chef?
@fjcero
fjcero / pr.md
Created March 25, 2013 14:30 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: