Skip to content

Instantly share code, notes, and snippets.

# This is Git's per-user configuration file.
[alias]
hist = log --all --decorate --oneline --graph
up = !git checkout master && git pull && git checkout - && git rebase master
pf = push --force-with-lease
bs = branch -v
grep-all = !git grep $1 $(git rev-list --all)
code-changes = "!git log --format=format: --name-only | egrep -v '^$' | sort | uniq -c | sort -rg | head -10"
cc = "!git code-changes"
(require '[clojure.string :as str])
(defn freq [s] (-> s str/lower-case (str/replace #"\s" "") frequencies))
(defn occurs [s c] ((freq s) c))
(occurs "Hello World" \h)
@frenata
frenata / Wahoo_Elemnt.md
Created February 25, 2021 16:49 — forked from Intyre/Wahoo_Elemnt.md
Wahoo Elemnt - Tips, tricks and custom images
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
set -g default-terminal "screen-256color"
# keybindings
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# Change the 'leader' key (the prefix by which you 'command' tmux itself rather than type)
# -- I hate pressing ctrl all the time, so instead I remap this to the ` key.
# Basically for all tmux commands, now type ` followed by the command.
@frenata
frenata / core.clj
Last active March 28, 2019 20:40
4clojure
(ns for-clj.core)
;; utils
(defn
digits [n base]
(loop [n n b base acc '()]
(let [[q m] ((juxt quot mod) n b)
d (/ (* base m) b)]
(if (> q 0)
@frenata
frenata / http.coco
Created May 26, 2018 17:43
http headers in coconut
import sys
import requests as req
def get(url) =
outputs |> fmap$(print) where:
result = url |> req.get
status = (result
|> .status_code
|> "Status Code: {}".format$())
@frenata
frenata / Boilerplate.elm
Created May 4, 2018 13:46
Elm Boilerplate
module Monitor exposing (..)
import Html exposing (..)
{-| Single source of truth
-}
type alias Model =
{ text : String }
import Data.Char
import Data.Monoid
zipRot :: Int -> [a] -> [(a, a)]
zipRot n xs =
let rotXs = (drop n xs) ++ (take n xs)
in zip xs rotXs
captcha :: (Monoid a, Eq a) => Int -> [a] -> a
captcha n xs =
@frenata
frenata / GHCi usage
Created October 12, 2017 20:37
Haskell Hashtables!
table = mkHashTable 10
table
|> insert ("bob", "bob metadata")
|> insert ("alice", "alice metadata")
|> delete "bob"
|> search "bob"