Skip to content

Instantly share code, notes, and snippets.

View foca's full-sized avatar

Nicolás Sanguinetti foca

View GitHub Profile

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 July 6, 2018 23:26
Tiny script to build GNU Make dependency files for JS `import` rules or CSS `@import` rules.
#!/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 April 17, 2017 05:22
Use root keys and nested serializers with Granola
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 January 5, 2017 06:45
Make CodeTree less terrible on the eyes.
/**
* 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 July 27, 2016 13:38
It's Fine • A Tale of Terrible Misfortune

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 March 31, 2023 14:15
Small shell script to create GitHub releases from the command line
#!/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 September 25, 2015 14:50
Stupid heroku wants Bundler. Bundler is shit. Make to the rescue.
##
# 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 May 10, 2023 20:55
A Makefile for developing a ruby gem

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 February 7, 2015 21:16
A tool to load a `.tmuxify.layout` file and open a GNU Screen session with it. See https://github.com/tonchis/tmuxify
#!/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 August 29, 2015 14:07
Find which tests always run before a given test when the suite fails, in order to detect ordering issues in your test suite.
#!/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.