Skip to content

Instantly share code, notes, and snippets.

View fabioyamate's full-sized avatar

Fabio Yamate fabioyamate

View GitHub Profile
#!/bin/bash
# TODO would it be possible to write in one line?
echo "Password: "
read -s password
echo -n $password | openssl dgst -sha256 -binary | xxd -p
@fabioyamate
fabioyamate / xmobarrc
Created March 14, 2017 13:53
Xmonad config
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, borderColor = "black"
, border = TopB
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 100
, commands = [ Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
#!/bin/bash
foo=$1
p1=
cat <(`dd bs=1024 count=64 if=$foo`) <(`tail -c 65536 $foo`) | md5
@fabioyamate
fabioyamate / keybase.md
Created February 21, 2016 02:13
keybase prove github

Keybase proof

I hereby claim:

  • I am fabioyamate on github.
  • I am fabioyamate (https://keybase.io/fabioyamate) on keybase.
  • I have a public key ASCozQOWUcCj_hY3NCJ60wJIR0BMIfMVE5AVlC8I_PCkCgo

To claim this, I am signing this object:

@fabioyamate
fabioyamate / core.clj
Created August 31, 2015 03:20
Stub HTTP server
(ns stubhttp.core
(:require [ring.adapter.jetty :as r]
[ring.middleware.json :as json]
[ring.util.response :as response]))
(def state (atom {}))
(defn register! [{uri "uri" {:strs [status headers body]} "response"}]
(swap! state assoc uri {:status status :headers headers :body body}))
@fabioyamate
fabioyamate / .screenrc
Created May 22, 2015 11:44
.screenrc file
# http://www.gnu.org/software/screen/manual/html_node/Command-Summary.html#Command-Summary
# Turn off start message
startup_message off
termcapinfo rxvt-unicode 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
term screen
# Message to display in the status line when activity is detected in a
# monitored window.
@fabioyamate
fabioyamate / datomic-queries.clj
Created April 30, 2015 16:32
Datomic Queries cheat-sheet
;;; Replace entity with the schema
{:find [...]
:in [...]
:where [...]}
;;; eav
[?e ?a ?v ?tx]
;;; txInstant
@fabioyamate
fabioyamate / event_target.js
Created December 19, 2014 13:42
EventTarget mixin module
// draft
(function(exports) {
var ArrayProto = Array.prototype;
var nativeSlice = ArrayProto.slice,
nativeFilter = ArrayProto.filter;
/* Internal: filters the collection. (extracted from underscore.js)
*
@fabioyamate
fabioyamate / affix-sandbox.html
Created December 17, 2014 20:49
Affix test
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Snippet</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<style>
#text {height: 100%; background-color: pink}
#header { background-color: red; }
#header.affix {
@fabioyamate
fabioyamate / nth-last-child.html
Created October 16, 2014 19:50
nth-last-child
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
li:nth-last-child(3) { background-color: red; }
</style>
</head>
<body>
<div id="container">