Skip to content

Instantly share code, notes, and snippets.

View fuzzyalej's full-sized avatar
🎯
Focusing

Alejandro Andrés fuzzyalej

🎯
Focusing
View GitHub Profile
@fuzzyalej
fuzzyalej / about.md
Created February 2, 2012 09:28 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@fuzzyalej
fuzzyalej / histogram.lisp
Created April 17, 2014 16:05
Histogram exercise to learn arrays. Example from "Common Lisp: A gentle introduction to symbolic computation"
(defvar *total-points* nil)
(defvar *hist-array* nil)
(defun record-value (n)
(if (or (> n 10)
(< n 0))
(break "The supplied argument is not between 0 and 10"))
(setf (aref *hist-array* n) (+ 1 (aref *hist-array* n)))
(setf *total-points* (+ 1 *total-points*)))
@fuzzyalej
fuzzyalej / gist:11258873
Created April 24, 2014 15:29
CL DSL for generation API documentation
(generate-api-documentation
:base "http://api.test.com"
:title "API Documentaition for TEST"
:author "fuzzyalej"
(with-endpoint "/book"
:method "GET"
:description "This will fetch a book from the database"
(parameters
(id
:type "String"
@fuzzyalej
fuzzyalej / gist:dd3eaddec7eb2b0e7444
Created August 21, 2014 09:34
Delete old remote branches

Say you have a repo structured by features, issues, etc:

fuzzyalej@MightyPirate:~/code/supersecretproject (master)$ git branch -a
  develop
  issue/399
* master
  remotes/backup/master
  remotes/origin/HEAD -> origin/master
 remotes/origin/feature/234
@fuzzyalej
fuzzyalej / introrx.md
Last active August 29, 2015 14:10 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

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.

@fuzzyalej
fuzzyalej / redact.js
Last active August 29, 2015 14:14 — forked from werelax/redact.js
// utils
var slice = Array.prototype.slice;
var concat = Array.prototype.concat;
var flatten = function(l) { return concat.apply([], l); };
// really stupid DSL
function nodeOrTextNode(n) {
if (typeof(n) === "object")

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@fuzzyalej
fuzzyalej / gist:604f731533c7d3fcd077
Last active August 29, 2015 14:16
Debugging Sphinx

If you are a heavy user of thinking sphinx you might have encounter some tricky stuff that could be easily solved if you were able to actually see the indexed data.

Well, you can easily solve that now: mysql --host 127.0.0.1 --port 9306

With that, you have console access to the index database, that you can query with SphinxQL (http://sphinxsearch.com/docs/current.html#sphinxql-reference)

note: if you are using rails, the ID of the model is not id but sphinx_internal_id :)