Skip to content

Instantly share code, notes, and snippets.

Nicolás Sanguinetti foca

Block or report user

Report or block foca

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 keybase.md

Keybase proof

I hereby claim:

  • I am foca on github.
  • I am foca (https://keybase.io/foca) on keybase.
  • I have a public key whose fingerprint is 96C6 54DB 13EA 4B40 A061 0BC5 5BC4 04A2 96AD ABC8

To claim this, I am signing this object:

@foca
foca / asset-makedepend
Created Jul 6, 2018
Tiny script to build GNU Make dependency files for JS `import` rules or CSS `@import` rules.
View asset-makedepend
#!/usr/bin/env ruby
# Generate make dependencies by parsing a tree of JS / CSS files.
#
# Usage
# -----
#
# Add this to your Makefile:
#
# ```
@foca
foca / granola_with_root_keys.rb
Last active Apr 17, 2017
Use root keys and nested serializers with Granola
View granola_with_root_keys.rb
require "granola"
class BaseSerializer < Granola::Serializer
def to_json(**opts, &block)
root_serializer = RootSerializer.new(self)
Granola.renderer(:json).render(root_serializer, **opts, &block)
end
end
class RootSerializer < Granola::Serializer
@foca
foca / codetree-user-styles.css
Created Jan 5, 2017
Make CodeTree less terrible on the eyes.
View codetree-user-styles.css
/**
* CodeTree default styles are pretty terrible, and the task board
* is pretty cluttered with lots of useless things.
*
* This is a user stylesheet that makes the board pretty clean by
* removing the sidebar and top navigation.
*
* You should apply it to URLs matching `/projects/\w+/board`
*
*
@foca
foca / its-fine.md
Last active Jul 27, 2016
It's Fine • A Tale of Terrible Misfortune
View its-fine.md

This is a talk I gave for the Hacker Paradise Summer '16 crew at Porto, Portugal. You can find the slides at SpeakerDeck. Photo Credits at the bottom.

It's Fine • A Tale of Terrible Misfortune

I'm gonna tell you the story of a little startup. It started with an idea, as startups often do. Two passionate people saw that certain people on the internet had a problem, and they could solve it for them. For a small fee, of course.

They wanted to avoid venture capital and investors, so from the get-go they were fully bootstrapped, which meant working during their free time. But they were to be their own bosses, and finally be free and financially independent. They were excited! It was a time of joy.

They started small and lean. One of them a designer, the other a developer. They figured out the best way to get it done was to crank away, so they jumped into creating a prototype straight away.

@foca
foca / release
Last active Nov 17, 2019
Small shell script to create GitHub releases from the command line
View release
#!/usr/bin/env bash
set -e
[ -z "$DEBUG" ] || set -x;
usage() {
echo "$0 <repo> <tag> [<release name>] [-- <asset>...]" >&2;
}
if [ "$1" = "-h" -o "$1" = "--help" ]; then
@foca
foca / Makefile
Last active Sep 25, 2015
Stupid heroku wants Bundler. Bundler is shit. Make to the rescue.
View Makefile
##
# Bundler for Heroku
##
Gemfile.lock: Gemfile
ruby -S bundle install
Gemfile: .gems
echo "source \"https://rubygems.org\"" > $@
echo "ruby \"$(shell ruby -e 'puts RUBY_VERSION')\"" >> $@
@foca
foca / 0_README.md
Last active Aug 29, 2018
A Makefile for developing a ruby gem
View 0_README.md

A Makefile for building ruby gems

This Makefile aids in developing a ruby gem. It's pretty opinionated to my workflow, but it might be useful to you, so here it goes.

  1. Assumes you use of [gs][gs] (or [gst][gst]) for managing gemsets.
  2. Assumes you use [dep][dep] for installing dependencies. Because fuck Bundler.
  3. Assumes the directory in which the source code is located is named after the gem. So basename $(dirname $(pwd)) would return foo
@foca
foca / screenify
Created Feb 7, 2015
A tool to load a `.tmuxify.layout` file and open a GNU Screen session with it. See https://github.com/tonchis/tmuxify
View screenify
#!/usr/bin/env bash
set -e
[ -n "$DEBUG" ] && set -x
layout="$(pwd)/.tmuxify.layout"
if [ ! -f "$layout" ]; then
echo "Can't find ./.tmuxify.layout" >&2
exit 1
@foca
foca / inspector.rb
Last active Aug 29, 2015
Find which tests always run before a given test when the suite fails, in order to detect ordering issues in your test suite.
View inspector.rb
#!/usr/bin/env ruby
#
# Find repeated output across runs of a process.
#
# Usage:
#
# ./inspector "./minitest-runner some_failing_test"
#
# The main purpose for this is to find tests that pollute the environment making
# other tests fail erratically, for test suites that run in a random order.
You can’t perform that action at this time.