Skip to content

Instantly share code, notes, and snippets.

View connectthefuture's full-sized avatar

justthefracts connectthefuture

  • Midwest usa
View GitHub Profile
@connectthefuture
connectthefuture / t.py
Created September 12, 2016 21:58 — forked from kennethreitz/t.py
def dictify(s):
items = s.split()
for i, item in enumerate(items):
if ':' in item:
items[i] = item.split(':')
else:
items[i] = (item, True)
print dict(items)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.25882352941176473</real>
@connectthefuture
connectthefuture / gist:759b51be78a3fb29f4031fe79e397f6e
Created July 27, 2017 20:40 — forked from nathanmarz/gist:1165885
Benchmark between HashMap with lock vs. persistent map with atom
(defn map-incr-unsafe []
(let [m (java.util.HashMap.)]
(.put m "a" 0)
(doseq [i (range 1000000)]
(let [a (.get m "a")]
(.put m "a" (inc a))
))))
(defn map-incr-safe []
(let [o (Object.)
@connectthefuture
connectthefuture / .osx
Created August 6, 2017 08:12 — forked from chaseconey/.osx
OSX Setup Script
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@connectthefuture
connectthefuture / vimgolf.vimrc
Created October 12, 2017 02:24 — forked from igrigorik/vimgolf.vimrc
Basic vimrc to level the playing field...
" http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc
set nocompatible " use vim defaults
set scrolloff=3 " keep 3 lines when scrolling
set ai " set auto-indenting on for programming
set showcmd " display incomplete commands
set nobackup " do not keep a backup file
set number " show line numbers
set ruler " show the current row and column
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@connectthefuture
connectthefuture / build-llvm.bash
Created November 28, 2017 16:48 — forked from zchee/build-llvm.bash
Build llvm for OS X
#!/bin/bash
set -e
# Building LLVM on OSX CMake setup script
#
# Required:
# - clang by Xcode6 or later
# - cmake
# - ninja
#
@connectthefuture
connectthefuture / sysctl.darwin.md
Created November 28, 2017 16:51 — forked from zchee/sysctl.darwin.md
sysctl(3) Darwin Kernel Version 15.2.0

from man page

> uname -asnrvmpio
Darwin zchee-darwin-amd64.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:43:59 PST 2015; root:xnu-3248.20.55~1/RELEASE_X86_64 x86_64 i386 MacBookPro11,3 Darwin

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.2
BuildVersion: 15C47a