Skip to content

Instantly share code, notes, and snippets.

View bonjourmauko's full-sized avatar

Mauko Quiroga-Alvarado bonjourmauko

View GitHub Profile
@Morendil
Morendil / test_yamls.py
Created October 20, 2018 20:15
openfisca-run-test replacement using Pytest
from yaml import CLoader as Loader, CDumper as Dumper
import pytest
import glob
import yaml
import numpy
from openfisca_core import scenarios
from openfisca_core.scripts import build_tax_benefit_system
@Susensio
Susensio / numpy_lru_cache.md
Last active November 26, 2024 21:25
Make function of numpy array cacheable

How to cache slow functions with numpy.array as function parameter on Python

TL;DR

from numpy_lru_cache_decorator import np_cache

@np_cache()
def function(array):
 ...
@jasny
jasny / bootstrap-em.less
Last active January 5, 2020 15:36
Use em or rem font-size in Bootstrap 3
/**
* Use em or rem font-size in Bootstrap 3
*/
@font-size-root: 14px;
@font-unit: 0rem; // Pick em or rem here
// Convert all variables to em
@thomd
thomd / semantic-layout.html
Last active November 11, 2024 20:30
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@endymion
endymion / contact.rb
Last active February 18, 2024 22:49
Example of integrating a Ruby on Rails app with Zapier using the REST hooks pattern. With support for triggering the REST hooks from Resque background jobs.
class Contact < ActiveRecord::Base
...
def after_create
if Hook.hooks_exist?('new_contact', self)
Resque.enqueue(Hook, self.class.name, self.id)
# To trigger directly without Resque: Hook.trigger('new_contact', self)
end
end
@acidlabs-snippets
acidlabs-snippets / capistrano.rb
Created October 4, 2012 16:15
Rails 3.1+ Multistage deployment with Capistrano #rails #deployment #capistrano
### This gist outlines a generic implementation of multistage deployment with Capistrano for Rails 3.1+.
#
# Usage:
#
# cap #{stage} deploy:setup
# cap #{stage} deploy:cold
# cap #{stage} deploy
#
# etc.
@chetan
chetan / yardoc_cheatsheet.md
Last active April 13, 2025 14:08
YARD cheatsheet
@fnhipster
fnhipster / html5.haml
Created April 9, 2011 01:19
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }