Skip to content

Instantly share code, notes, and snippets.

@juxtin
juxtin / vim74centos
Last active May 2, 2022 03:45
Compile Vim 7.4 on Centos and install my vimrc
#!/bin/bash
yum groupinstall 'Development tools' -y
yum install ncurses ncurses-devel wget git -y
cd /usr/local/src
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
tar -xjf vim-7.4.tar.bz2
cd vim74
./configure --prefix=/usr --with-features=huge --enable-rubyinterp --enable-pythoninterp
make && make install
@juxtin
juxtin / Main.hs
Last active August 29, 2017 01:14
Hiding STM behind a generic IO storage interface
module Main where
import Control.Concurrent.STM
import Data.Map as M
type MapDB = M.Map Integer String
main :: IO ()
main = do
stg <- initStorage
@juxtin
juxtin / puppetserver-get.sh
Created August 18, 2017 23:11
Perform a curl GET request to the given puppet server endpoint in PE
#!/bin/bash
# example:
# ./puppetserver-get /puppet/v3/environments
FQDN=$(facter fqdn)
CERTS="/etc/puppetlabs/puppet/ssl/certs"
KEYS="/etc/puppetlabs/puppet/ssl/private_keys"
curl "https://${FQDN}:8140$1" \
b64map : [64][8]
b64map = ['A' .. 'Z'] # ['a' .. 'z'] # ['0' .. '9'] # ['/', '+']
toB64Char : [6] -> [8]
toB64Char x = b64map @ x
base64 xs = [ toB64Char x | x <- hexBytes ]
where hexBytes = groupBy`{6} xs
passes = actual == expected
@juxtin
juxtin / 50-mtrack.conf
Created March 23, 2016 06:44
Working mtrack config
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
Option "Sensitivity" "0.35"
Option "IgnoreThumb" "true"
Option "IgnorePalm" "true"
Option "TapButton1" "1"
Option "TapButton2" "3"
(defun abclj--other-ns (ns)
"If `ns' ends in `-test', strip that off. Otherwise, add `-test'."
(if (string-match-p "-test$" ns)
(string-remove-suffix "-test" ns)
(concat ns "-test")))
(defun abclj-jump-to-test-ns-or-back (&optional arg)
"If the point is in `project.namespace', jump to `project.namespace-test'. If
the point is in `project.namespace-test', jump to `project.namespace'."
(interactive "P")
(defproject typed-rbac "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:core.typed {:check [typed-rbac.types]}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/core.typed "0.3.22"]])
(ns typed-test.types
{:lang :core.typed}
(:require [clojure.core.typed :as t]))
(def BaseUser
(t/HMap
:mandatory
{:id java.util.UUID
:login t/Str}
:complete? true))
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/04/Fill.asm
// Runs an infinite loop that listens to the keyboard input.
// When a key is pressed (any key), the program blackens the screen,
// i.e. writes "black" in every pixel. When no key is pressed, the
// program clears the screen, i.e. writes "white" in every pixel.
the AJAX CALL SUCCEEEDEDEDEDDDDD