Skip to content

Instantly share code, notes, and snippets.

@thejohnfreeman
thejohnfreeman / gist:448f924edea8a7f7f7a0
Created June 11, 2015 21:23
Python Popen with timeout
import os
import signal
import subprocess
import threading
class AsyncPopen(threading.Thread):
def __init__(self, command, stdin=None, **kwargs):
self.command = command
self.stdin = stdin
function NotPimpl(x) {
// more than one assignment, "deep" copy
this.first = x.first
this.last = x.last
}
NotPimpl.prototype.fullName = function() {
// direct members, fast
return this.first + this.last
}
roundRobin :: Int -> [a] -> [[a]]
roundRobin n xs =
let (hs, ts) = splitAt n xs
in zipWith (:) hs (roundRobin n ts ++ repeat [])
module Main where
import System.Environment
main :: IO ()
main = do
args <- getArgs
let num1 = read $ args !! 0
let num2 = read $ args !! 1
res <- num1 + num2
print res
configurations {
checker
}
dependencies {
checker 'org.checkerframework:checker:1.9.6'
checker 'org.checkerframework:jdk8:1.9.6'
compile configurations.checker.dependencies
compile 'com.google.guava:guava:19.0'
}
@thejohnfreeman
thejohnfreeman / gist:63e51273599006402558fb04102b1c5a
Created July 10, 2016 13:04
IntelliJ External Tool: Open in Vim
Program: env
Parameters: -u TMUX /usr/bin/gnome-terminal -e "bash -i -c 'vim +\"silent! $LineNumber$|norm! zz\" $FilePath$'"
Working directory: $SourcepathEntry$

Keybase proof

I hereby claim:

  • I am thejohnfreeman on github.
  • I am jfreeman (https://keybase.io/jfreeman) on keybase.
  • I have a public key whose fingerprint is 30BF E4CC 507D 60C6 3945 4D81 99AE 9F64 3744 325D

To claim this, I am signing this object:

@thejohnfreeman
thejohnfreeman / investigate.md
Last active January 14, 2017 07:10
Automated code quality tools
@thejohnfreeman
thejohnfreeman / instructions.md
Last active January 5, 2023 02:15
Semantic UI fonts with Webpack in a Chrome extension

To get Semantic UI fonts working:

  1. npm install semantic-ui-css

  2. Import 'semantic-ui-css/semantic.css' in your entry script. The exact syntax for this varies depending on your chosen module format: import for ES6, require for CommonJS, etc. This tells Webpack to pull the CSS into your bundle.

  3. npm install --save-dev style-loader css-loader

@thejohnfreeman
thejohnfreeman / feedback.md
Last active January 20, 2018 00:58
Tight feedback loop
watchexec --ignore dist/ --exts ts,js,json npm test
while true; do ls build/manifest.json | entr bash -c 'rsync --archive --delete build/ ~/shared/mint-ui/ && date'; done