Skip to content

Instantly share code, notes, and snippets.

Ekaitz Zárraga ekaitz-zarraga

View GitHub Profile
@ekaitz-zarraga
ekaitz-zarraga / bisection.clj
Last active Jan 24, 2019
Example code for Bisection method in Clojure
View bisection.clj
; Example code for Bisection method
; https://en.wikipedia.org/wiki/Bisection_method
(defn f
"Example function to apply algorithm on"
[x]
(+ 3 x))
(defn distance
[a b]
View storage.clj
(ns asktodon.storage
(:require [clojure.core.async :as a]))
(defonce client-data-file "client-data.edn")
(defn- load-client-data
"Load client data file, supposed to be done only once."
[client-data-file]
(try
(read-string (slurp client-data-file))
(catch Exception e
@ekaitz-zarraga
ekaitz-zarraga / whiteboardCleaner.md
Created May 24, 2018 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@ekaitz-zarraga
ekaitz-zarraga / index.js
Last active Dec 4, 2017
Robohydra frontend-dev-proxy to use with figwheel
View index.js
var heads = require("robohydra").heads,
RoboHydraHeadProxy = heads.RoboHydraHeadProxy,
RoboHydraHeadFilesystem = heads.RoboHydraHeadFilesystem;
// Configuration variables:
// * urlfigwheel: url to proxy to figwheel
// * urlproxy: url to proxy
// * figwheelto: remote URL of the figwheel server. Defaults to 'http:localhost:3449'
// * proxyto: remote URL of the proxy.
// * sethostheader: if the "Host" header should be set to the URL the
@ekaitz-zarraga
ekaitz-zarraga / convertMaki.sh
Created Nov 28, 2017
Convert Maki Icons to PNG in different colors
View convertMaki.sh
#!/bin/bash
# LICENSE:
# Copyright © 2017 Ekaitz Zárraga <ekaitz.zarraga@protonmail.com>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the COPYING file for more details.
# Convert certain icons from Mapbox Maki icons to PNGs in different colors
@ekaitz-zarraga
ekaitz-zarraga / cryptonight.coffee
Last active Jan 2, 2018
Pseudocode for CryptoNight made in CoffeeScript
View cryptonight.coffee
# Pseudocode for Cryptonight
# --------------------------
#
# Written in CoffeeScript for simplicity but untested.
# See:
# https://cryptonote.org/cns/cns008.txt
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ekaitz-zarraga
ekaitz-zarraga / usb_hid_keys.h
Created Oct 27, 2017 — forked from MightyPork/usb_hid_keys.h
USB HID Keyboard scan codes
View usb_hid_keys.h
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@ekaitz-zarraga
ekaitz-zarraga / infinite_seq.clj
Created Apr 27, 2017
Clojure Infinite sequence example
View infinite_seq.clj
(defn lista
([] (lista 1))
([one] (lazy-seq (cons one (lista (+ one 1))))))
(defn fibo
([] (fibo 0 1))
([one two] (lazy-seq (cons one (fibo two (+ one two ))))))
(defn -main
[& args]
View drowmark.wp
[wordpress]
# Title of your blog post here
# Example: title = My cool blog post in here
title = droWMark, postea en Wordpress desde Vim
# The status you want for your blog post here. Options are:
# draft, published, pending, private
# Example: status = published
status = draft
@ekaitz-zarraga
ekaitz-zarraga / panflute-test.py
Created Feb 23, 2017
Test panflute. Capture Image URLs and change them.
View panflute-test.py
import panflute as pf
"""
Stupid panflute test, capture Image URLs and change them, prints this:
Hola, esto es un docu
=====================
![IMAGEN](otra_url)
You can’t perform that action at this time.