Skip to content

Instantly share code, notes, and snippets.

View junosuarez's full-sized avatar
💭
hi hello

juno suárez junosuarez

💭
hi hello
View GitHub Profile
modules.map(
plumb(
project.add({
lang: plumb(
to('readme'),
cld.detect,
to('code'))
}),
project({
_id: 1,
@junosuarez
junosuarez / gist:5630051
Last active December 17, 2015 15:09
I will never complain about SQL again
// which modules is an entity in
e.filter(function (e) {
return m.filter(function (m) {
return m.entities.some(function (me) {
return me.entityId.equals(e._id) }) }).length > 1 })
.map(function (x) {
return [x._id,'in']
.concat(db.AD_Modules.find({'entities.entityId': x._id, private: {$ne: true}}, {titleShort:1})
.map(I)) })
@junosuarez
junosuarez / gist:5751347
Created June 10, 2013 19:09
git prompt
function parse_git_branch {
local W="\033[1;37m"
local ref=$(git symbolic-ref HEAD 2> /dev/null)
if [[ -z $ref ]]; then
return
fi
echo -e $W"/"${ref#refs/heads/}" "
}
@junosuarez
junosuarez / gist:5843202
Created June 23, 2013 00:15
Example using the npm modules `minq`, `tracery`, and `Q`
var tracery = require('tracery')
var minq = require('minq')
var ObjectId = require('objectid')
var Q = require('q')
minq.connect('mongodb://localhost:27017/test_db')
var isUser = tracery({
// here, we're using a predicate function ObjectId.isValid which will return true is the value is, in fact, an ObjectId
_id: ObjectId.isValid,
@junosuarez
junosuarez / gist:5862868
Last active December 18, 2015 23:39
An open letter to Counter Burger
Dear Counter -
I love your burgers, especially your house-made veggie patties and quality
topping ingredients. However, I wanted to share a recent experience that
made me uncomfortable.
I placed an order through your website for pickup, along with some of my
co-workers. When I received the order confirmation email, I saw my password
repeated to me in plain text (without encryption). As a software developer,
this is very concerning to me and makes me feel uncomfortable sharing
information like credit card numbers on your website. I know you take customer
@junosuarez
junosuarez / Dockerfile
Last active December 19, 2015 12:29
F# 3.0 in a Docker image
# DOCKER-VERSION 0.4.8
FROM base:ubuntu-12.10
RUN apt-get -y install mono-devel autoconf pkg-config make git libtool
RUN git clone https://github.com/fsharp/fsharp
RUN cd fsharp && ./autogen.sh --prefix /usr && make && make install
@junosuarez
junosuarez / gist:6181848
Created August 8, 2013 05:57
notes from SF Open Legislation Hack Night, 2013.08.07
what's the easiest way to be able to observe areas of change - and proposed change - of machine readable code?
way to model and capture legislative behavior and change management on bodies of legislation as a service.
respect for line numbers, section numbers, section references, range references
don't just model legislation as a living document, but capture the actual bills for amending said legislation
also capture change process for the bills
(basically like working in a feature branch)
jden:api /ci * $ cat test.js
"use strict"
const a
a++
jden:api /ci * $ node test
/Users/jden/dev/api/test.js:2
const a
^^^^^
SyntaxError: Use of const in strict mode.
@junosuarez
junosuarez / gist:6599514
Created September 17, 2013 19:44
sublime text colors
<!-- jden custom -->
<dict>
<key>name</key>
<string>Plaintext</string>
<key>scope</key>
<string>text.plain</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#69C835</string>
This is not governance. I detest partisan hackery and soft analysis, but -
or perhaps ergo - the House leadership's tactics amount to cheap, deplorable
posturing. Which would be bad enough on its own, if it weren't for the very
real consequences that it now looks like we'll see tomorrow. This kind of
scorched earth, my-way-or-to-hell-with-it-all negotiation is not how good
policy is made. It is completely disingenuous to engage in this behavior and
try to justify it with a means-end argument and say it's "for the good of the
country/the people/my donor base." Well, maybe the last one.