Skip to content

Instantly share code, notes, and snippets.

View fgui's full-sized avatar

Francesc Guillén Torruella fgui

View GitHub Profile
@fgui
fgui / i3wm_config
Last active October 16, 2015 08:08
i3wm config
# config i3
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#

Keybase proof

I hereby claim:

  • I am fgui on github.
  • I am fgui (https://keybase.io/fgui) on keybase.
  • I have a public key whose fingerprint is 62FC 71C1 B76E 98C6 8F29 9214 2667 3348 5C03 FAC0

To claim this, I am signing this object:

@fgui
fgui / .Xmodmap
Created July 23, 2015 11:23
.Xmodmap config file
! output taken from:
! xmodmap -pke | egrep '(Control|Super|Alt|Menu)'
! Use to set keycodes correctly below. List reordered to match
! keys from left to right.
! run xmodmap .Xmodmap to test changes.
! keycode 66 = CapsLock
! keycode 37 = Control_L NoSymbol Control_L
! keycode 133 = Super_L NoSymbol Super_L
! keycode 64 = Alt_L Meta_L Alt_L Meta_L
@fgui
fgui / core_async_for_web_notes.cljs
Last active August 29, 2015 14:25
clojurescript core.async
;; listen to event in javascript dom
;; https://swannodette.github.io/2013/11/07/clojurescript-101/
(defn listen [el type]
(let [out (chan)]
(events/listen el type
(fn [e] (put! out e)))
out))
(def clicks (listen (dom/getElement "search1") "click"))
(defn scip-ex13
"Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers."
[& args]
(apply + (->> args (sort) (reverse) (take 2) (map #(* % %)))))
@fgui
fgui / 10-keyboard.conf
Last active August 29, 2015 14:27
space as ctrl with at home modifier ubuntu
https://gitlab.com/at-home-modifier/at-home-modifier-evdev
Map space (65:37) and capslock (66:37) to control for combination with other keys.
Depending on the keyboard sometimes space works as a control if typing space and key at same time.
It almost never happens to me with a mechanical keyboard or the old thinkpad keyboard.
## for ubuntu
sudo add-apt-repository ppa:yurivkhan/ahm
sudo apt-get update
@fgui
fgui / indexof.cljc
Created September 29, 2015 11:53
indexof.cljc
;; indexOf depends on hosted language (java/javascript)
;; recurrent solution , returns -1 on not-found
(defn index-of [coll value]
(loop [idx 0 items coll]
(cond
(empty? items) -1
(= value (first items)) idx
:else (recur (inc idx) (rest items)))))
@fgui
fgui / intro-clojure-es.org
Last active October 9, 2015 09:38
introducción a clojure

introducción a clojure / clojurescript

¿clojure?

dialecto de LISP

  • dynamic
  • funcional
  • el código son datos (homoiconic)
  • syntactic abstractions
    • functions
    • macros (no reader macros)
@fgui
fgui / build.boot
Created October 10, 2015 07:45
basic boot build config for a lein new project
(set-env!
:source-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.7.0"]
[adzerk/boot-test "1.0.4" :scope "test"]]
)
(require '[adzerk.boot-test :refer :all])
(deftask testing
"Profile setup for running tests."
@fgui
fgui / intro1.clj
Last active October 15, 2015 16:25
intro to clojure with repl
(ns clj-bcn.intro1)
(comment
;;; literals ;;;
"string"
\s
1
3/4
123412342134214312342134N