Skip to content

Instantly share code, notes, and snippets.

View aitor's full-sized avatar
👊
Working!

Aitor García Rey aitor

👊
Working!
View GitHub Profile
@dobaduc
dobaduc / EasyLocalization.swift
Last active November 14, 2019 16:38
Tiny useful wrapper function of NSLocalizedString in Swift
//
// EasyLocalization.swift
//
// Created by Doba Duc on 9/1/15.
// Copyright (c) 2015 Doba Duc. All rights reserved.
//
/// Tiny useful wrapper function of NSLocalizedString in Swift
///
/// @param key Localizable key

You can trigger a GitHub Pages (Jekyll) rebuild with a single API call. This is pretty useful for auto-publishing blog posts from a bot like Zapier in conjunction with future: false in your Jekyll config.yml. Just future-date your posts, and they'll go live when that date rolls around. I use a version of this setup for my blog at greghaskins.com.

Setup

  1. Create a GitHub personal access token and save it somewhere. It needs to have the repo access scope (at least).

  2. Create a file at the root of your repo (e.g. .publish) with some dummy content.

    $ echo ".publish" > .publish
@jsanz
jsanz / README.md
Last active January 9, 2022 23:57
Analysis example: Voronoi on CartoDB

This example loads a CartoDB layer using a crazy SQL from a small variation of this awesome Stack Overflow response. Note the use of CSS style tags for the CartoCSS to allow easy editing.

The uncompressed (and not perfect!) version of the SQL to draw the Voronoi diagram is:

WITH 
    Sample AS (
      SELECT st_setsrid(st_union(the_geom),0) as geom 
      FROM registro_centros_nz WHERE spanish = 1
    ),
@zdne
zdne / gist:5f8295642af18aff27ec
Created June 17, 2015 10:47
Working with multiple API Blueprint files

Working with multiple blueprint files

This document describes 4 different solutions to work APIs that consist of multiple blueprint files. Every of this solution work with all Apiary.io features but editing. To edit a blueprint you have to do it outside of Apiary as Apiary editor does not support working with multiple files. In other words if you are using one of the solutions below avoid editing the blueprint in Apiary.

1. Hercule

Hercule is a CLI tool written in Node.js – available as an NPM package. It uses markdown referencing and linking syntax to transclude other files into a blueprint file. This solution is universal and would work with any Markdown files not just API Blueprint.

The major benefit – unlike any other solutions here – is also that the references are rendered as HTML links in any Markdown editor so the result is HTML that can be browsed!

@bomberstudios
bomberstudios / uxspain-2015.md
Last active April 26, 2020 15:12
Ale Muñoz — UX Spain 2015

Design Hacking — Mi chapa del UX Spain 2015

Hola, mundo

Soy Ale Muñoz. Nací en Sevilla, aunque ahora vivo con mi mujer y mi hija en Madrid, donde trabajo para una empresa holandesa, con un equipo repartido por toda Europa, haciendo software que se usa en todos los rincones del mundo.

Me gusta diseñar, cocinar, y sentarme plácidamente a poner la mente en blanco sin hacer absolutamente nada.

Llevo muchos años ayudando a diseñadores y diseñadoras a trabajar menos, fabricando herramientas para automatizar tareas, definiendo procesos de trabajo, o gestionando proyectos de diseño. Si alguna vez habéis trabajado conmigo es posible que os haya contado algún truco para hacer algo más rápido

import fiona
import click
from rasterio import features, Affine
def makeAffine(bounds, width):
xD = bounds[2] - bounds[0]
yD = bounds[3] - bounds[1]
cS = xD / float(width - 2)
height = int(yD / cS) + 1
@dvrensk
dvrensk / redsys_result_codes.rb
Created February 4, 2015 17:02
These are the result codes from Spanish payment gateway Redsys (formerly Sermepa) that I've managed to collect. The list is no doubt incomplete, and I'll be happy to update it if you have any more codes.
RESULT_CODES = (<<-EOT).split(/\r?\n/).reject {|s| s.match(/^( *#.*)?$/)}.map { |s| s.sub(/^ +/,'').split(/ +/,2) }.to_h
# Copied from http://dwalins.com/2014/codigo-de-respuesta-de-sermepa-redsys/
0101 Tarjeta Caducada
0102 Tarjeta en excepción transitoria o bajo sospecha de fraude
0104 Operación no permitida para esa tarjeta o terminal
0106 Intentos de PIN excedidos
0116 Disponible Insuficiente
0118 Tarjeta no Registrada
0125 Tarjeta no efectiva
0129 Código de seguridad (CVV2/CVC2) incorrecto

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.