Skip to content

Instantly share code, notes, and snippets.

View krisajenkins's full-sized avatar
💭
:: Geek

Kris Jenkins krisajenkins

💭
:: Geek
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

function! MyFoldText() " {{{
let line = getline(v:foldstart)
let nucolwidth = &fdc + &number * &numberwidth
let windowwidth = winwidth(0) - nucolwidth - 3
let foldedlinecount = v:foldend - v:foldstart
" expand tabs into spaces
let onetab = strpart(' ', 0, &tabstop)
let line = substitute(line, '\t', onetab, 'g')
package wlhn
import java.net.ServerSocket
import scala.io.BufferedSource
import java.io.PrintStream
import java.net.Socket
import java.net.InetAddress
import scala.collection.mutable.ArrayBuffer
/**
@gfredericks
gfredericks / hiccup-type.clj
Created March 6, 2014 20:19
The core.typed description of hiccup data
(t/def-alias HTML-Atts (IPersistentMap t/Keyword String))
(t/def-alias HTML
(Rec [HTML]
(U String
nil
(HVec [t/Keyword (U HTML (t/Seq HTML)) *])
(HVec [t/Keyword HTML-Atts (U HTML (t/Seq HTML)) *]))))
@k0001
k0001 / hello.hs
Last active September 25, 2015 19:32
-- | Add a prefix and a suffix to a given monoid. Problem: which of the arguments is which?
surround :: (Monoid a) => a -> a -> a -> a
-- | Add a prefix and a suffix to a given monoid. No problem!
surround :: (Monoid a, prefix ~ a, suffix ~ a) => prefix -> suffix -> a -> a
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Prelude hiding (log)
--------------------------------------------------------------------------------
-- The API for cloud files.
class Monad m => MonadCloud m where
saveFile :: Path -> Bytes -> m ()
@jarohen
jarohen / rafting.clj
Last active September 12, 2023 16:12
A quick hack at actually implementing the Raft algorithm to aid my learning - thanks @bbengfort and @krisajenkins for the podcast!
(ns rafting
(:require [clojure.tools.logging :as log])
(:import java.lang.AutoCloseable
(java.util.concurrent CompletableFuture Executors TimeUnit)))
(defn new-timeout-ms []
(+ (System/currentTimeMillis)
200
(rand-int 150)))