Skip to content

Instantly share code, notes, and snippets.

View fxn's full-sized avatar

Xavier Noria fxn

View GitHub Profile
@fxn
fxn / gist:e3823198a5a6b5f2cc39
Last active January 16, 2016 21:36
Thank you, GitHub motivation
I was the author of the letter, the account is mine.
The questions are too focused on Dear GitHub for my likening. My letter was a reaction to Dear GitHub, but not in itself that much about Dear GitHub.
The triggering was not suggesting improvements, that is fine. The trigger was the negative opening. That is of course legit, and my way to disagree with the tone is by not signing that one. This is important, my disagreement is expressed by not signing, not by Thank you, GitHub.
I am a core Rails dev and indeed GitHub has listened to when I have needed.
My reaction was to write a *different* letter expressing a different sentiment that I wanted to share. It is not about Dear GitHub, it is showing a sentiment of mine that has been in my head for time.
@fxn
fxn / problem-solving-games.md
Last active June 11, 2023 17:21
Problem-Solving Games
@fxn
fxn / orgs.txt
Created November 11, 2015 19:42
List of organizations that came to the GSoC 2015 mentors summit
52°North Initiative for Geospatial Open Source Software GmbH
Africa Soil Information Service
ASCEND
BeagleBoard.org
BEAM Community
Bika Open Source LIMS Collective
Biomedical Informatics, Emory University
Boost C++ Libraries
Boston University / XIA
BRL-CAD
def positive(list) do
positive_aux([], list)
end
defp positive_aux(acc, []), do: acc
defp positive_aux(acc, [head | tail]) when head > 0 do
positive_aux([head | acc], tail)
end
@fxn
fxn / user.ex
Created September 12, 2015 07:55
defp put_pass_hash(changeset) do
case changeset do
%Ecto.Changeset{valid?: true, changes: %{password: pass}} = chset ->
put_change(chset, :password_hash, Comeonin.Bcrypt.hashpwsalt(pass))
chset -> chset
end
end
@fxn
fxn / gsoc.md
Created September 10, 2015 07:33 — forked from febuiles/gsoc.md

Google Summer of Code Wrap up: Ruby on Rails

Rails is a Ruby framework that includes everything needed to create web applications. This was our fourth Summer of Code participation, and in this post we'd like to tell you a bit about this year's projects.

Asset Source Maps (Andrei Istratii)

Andrei has added support for several types of Source Maps to Sprockets 4. With Source Maps users can see a readable version of their code inside Developer Tools (Javascript, CSS, etc.) after it's been minified or compiled. Check out Andrei's

defmodule Hello.HelloController do
use Hello.Web, :controller
plug :action
def world(conn, %{"name" => name}) do
render conn, "world.html", name: name
end
end
module M
X = 1
end
module N
include M
end
N.const_defined?(:X) # => false in 1.8
@fxn
fxn / gist:427dca61ec44adf8253b
Last active July 2, 2019 18:14
gzip assets with Capistrano
# Compresses all .js and .css files under the assets path.
namespace :deploy do
# It is important that we execute this after :normalize_assets because
# ngx_http_gzip_static_module recommends that compressed and uncompressed
# variants have the same mtime. Note that gzip(1) sets the mtime of the
# compressed file after the original one automatically.
after :normalize_assets, :gzip_assets do
on release_roles(fetch(:assets_roles)) do
assets_path = release_path.join('public', fetch(:assets_prefix))
within assets_path do
@fxn
fxn / irpf.rb
Last active January 13, 2021 08:04
IRPF 2014
# Usage:
#
# ruby irpf.rb tax_base
#
# Example:
#
# ruby irpf.rb 65300
# 65300 €, 22722 €, 34.8%
#
# Where 22,722 € is the IRPF to pay, and 34.8% is the real rate, that is,