Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
from AppKit import NSWorkspace
print NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
(ns percolation.core
"Currently working for non-recursive, fully specified (no [:*]), attributes only (no limit, defaults etc.) pull api queries."
(:require [datomic.api :as d]))
(def schema
"Percolation specific schema"
[{:db/id #db/id[:db.part/db]
:db/ident :percolator/name
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
This tool is used to compare microbenchmarks across two versions of code. It's
paranoid about nulling out timing error, so the numbers should be meaningful.
It runs the benchmarks many times, scaling the iterations up if the benchmark
is extremely short, and it nulls out its own timing overhead while doing so. It
reports results graphically with a text interface in the terminal.
You first run it with --record, which generates a JSON dotfile with runtimes
for each of your benchmarks. Then you change the code and run again with
--compare, which re-runs and generates comparison plots between your recorded
and current times. In the example output, I did a --record on the master
@mdshw5
mdshw5 / .bashrc
Last active November 24, 2017 10:31
bash history in each writeable working directory
#!/bin/bash
# per-directory history
shopt -s histappend # always append to history, don't replace
export PROMPT_COMMAND="builtin history -a;$PROMPT_COMMAND" # write to history file at every new prompt
export HISTTIMEFORMAT="%m/%d/%y %T "
alias cd='cd_with_local_history'
alias history='cat $HOME/.bash_history'
export HISTFILE="$PWD/.bash_cwd_history_$USER"
function cd_with_local_history()
@erikdubbelboer
erikdubbelboer / gscp
Last active January 12, 2018 05:12
Google Cloud shell wrappers
#!/bin/bash
# Copy files from and to Google Compute Engine instances
# Automatically looks up the correct zone and uses ~/.ssh/id_rsa
# Usage
# gscp ./some.file some-instance-name:some-directory
# gscp some-instance-name:some-directory ./some.file
for project in $(gcloud projects list | grep -v PROJECT_ID | cut -d' ' -f 1); do
PROJECT=$project
@mhart
mhart / awslambda
Last active April 14, 2019 15:38
node_modules/awslambda
#!/usr/bin/env node
var path = require('path')
var fs = require('fs')
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
require(lib + '/awslambda.js').start_runtime();
@benjaminballard
benjaminballard / example_ops_manual.md
Last active August 29, 2019 08:33
Example VoltDB Operations Manual

VoltDB Operations Manual

This is an example of a document that a VoltDB customer or partner might write to document specific processes and commands for common operations with VoltDB.

Hardware & OS

For our VoltDB cluster, use servers with the following specs:
(Note: this is only an example, but you should document the exact hardware used for the installation, and use identical hardware if nodes to the cluster).

Amazon EC2 Example:

In production, we use c3.2xlarge nodes with 8 hyperthreads, 15GB of RAM

@patrickwelker
patrickwelker / evoluent-verticalmouse.xml
Created October 6, 2015 13:12
Karabiner Template to setup a secondary function key with the Evoluent Vertical Mouse. In this example Button 6 gets assigned the following modifiers: Shift-Right, Control-Right, Option-Right and Command-Right. Import via `<include path="YOUR-PATH-HERE/evoluent-verticalmouse.xml" />`
<?xml version="1.0"?>
<root>
<item>
<name>Evoluent VerticalMouse</name>
<appendix>All customizations only apply for the Evoluent VerticalMouse.</appendix>
<appendix>Note: button 4 (the mouse scroll button) and button 5 are swapped in Karabiner. I still use the default Evoluent labeling.</appendix>
<devicevendordef>
<vendorname>EVOLUENT</vendorname>
<vendorid>0x1a7c</vendorid>
</devicevendordef>
@HairyFotr
HairyFotr / gist:4995607
Created February 20, 2013 13:38
Scala Clojure interop wrapper
class ClojureWrap(ns: String, objName: String) {
import clojure.lang.{RT,Var}
import scala.collection.mutable.HashMap
RT.loadResourceScript(objName+".clj")
val obj = ns+"."+objName
val funcs = new HashMap[String, Var]
def /(func: String, a: Any): Object =
funcs.getOrElseUpdate(func, RT.`var`(obj, func)).invoke(a.asInstanceOf[Object])
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
index 2f4fe3a..fa74df9 100644
--- a/src/cmd/acme/acme.c
+++ b/src/cmd/acme/acme.c
@@ -42,11 +42,14 @@ char *fontnames[2] =
"/lib/font/bit/lucm/unicode.9.font"
};
+long *theme = nil;
+