Skip to content

Instantly share code, notes, and snippets.

Edgar edgar-humberto

Block or report user

Report or block edgar-humberto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8b61510a107dd40296e7398d12ec7e59
#!/usr/bin/env bash
# attribution to
echo -n “foo” | nc -4u -w1 <host> <udp port>
#Here’s quick breakdown of what’s happening:
#-n - Tells the echo command to not output the trailing newline.
#-4u Use IPV4 addresses only. Use UDP instead of TCP.
#-w1 Silently close the session after 1 second of idle time. That way, we’re not stuck waiting for more data.
edgar-humberto / gist:b5caa3f12563a87b86a3
Created Jun 3, 2015
Extending AngularJs Directives
View gist:b5caa3f12563a87b86a3
'use strict';
.directive('parent', function () {
return {
template: '<div>' +
'<ul>' +
'<li>Hello</li>' +
'<li>World</li>' +
'<li>Foo</li>' +
edgar-humberto / gulpfile.js
Last active Aug 29, 2015
Gulp task to inject modular angularjs and bower dependencies
View gulpfile.js
var gulp = require('gulp');
var inject = require("gulp-inject");
var wiredep = require('wiredep').stream;
gulp.task('default', function () {
var target = gulp.src('./app/index.html');
var sources = gulp.src([

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

edgar-humberto / gist:69d853b5856a7eb7b596
Created Dec 20, 2014
Traverse a directory structure recursively with "fs" and node.js
View gist:69d853b5856a7eb7b596
var fs = require("fs");
function travese(path, seperator) {
var parts = path.split("/"),
last = parts[parts.length - 1],
seperator = seperator || "";
View gist:3cfc973cbf1cd39010dd
define(function (require, exports, module) {
"use strict";
var Engine = require("famous/core/Engine"),
Surface = require("famous/core/Surface"),
Transitionable = require("famous/transitions/Transitionable"),
Modifier = require("famous/core/Modifier"),
Transform = require("famous/core/transform");
View Function Hoisting
var item = 4;
var sum = itemFunc() + 2;
item = 3;
function itemFunc(){return item;}
edgar-humberto / bower.json
Last active Aug 29, 2015
Sample NPM Karma Unit Test Setup
View bower.json
"name": "unittests",
"version": "0.0.0",
"authors": [
"edgarmartinez <>"
"moduleType": [
"license": "MIT",
View Famouse HeaderFooterLayotu with Scroll View
layout.header.add(new StateModifier({
transform: Transform.translate(0,0,1)
})).add(new Surface({
size: [undefined, 75],
content: "Header",
properties: {
lineHeight: "75px",
textAlign: "center",
color: "white",
View Famous Draggable
define(function (require, exports, module) {
var OptionsManager = require('famous/core/OptionsManager');
var MouseSync = require("famous/inputs/MouseSync");
var sync = new MouseSync();
function Draggable(options) {
this.options = Object.create(Draggable.DEFAULT_OPTIONS);
this._optionsManager = new OptionsManager(this.options);
You can’t perform that action at this time.