Skip to content

Instantly share code, notes, and snippets.

View whacked's full-sized avatar

whacked

  • let's do something cool together.
  • sillycon belly
View GitHub Profile
@whacked
whacked / default.nix
Created January 15, 2019 08:07
minimal expression for clean slate emacs
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "dev-env";
env = buildEnv {
name = name;
paths = buildInputs;
};
buildInputs = [
glibcLocales
gnome3.gtk
@whacked
whacked / default.nix
Created December 16, 2018 22:37
installing numpy on darwin with UCS4 with nix -- the missing link
# see https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/darwin/apple-sdk/frameworks.nix
let
pkgs = import <nixpkgs> {};
# MONEY LINE 1/2
frameworks = pkgs.darwin.apple_sdk.frameworks;
stdenv = pkgs.stdenv;
in stdenv.mkDerivation rec {
name = "env";
env = pkgs.buildEnv { name = name; paths = buildInputs; };
buildInputs = [
@whacked
whacked / Dockerfile
Created September 24, 2018 04:47
Set up perkeepd docker container
# docker build -t perkeep .
# make sure the config is like this:
# {
# "auth": "none",
# "listen": ":3179",
# "camliNetIP": "",
# "identity": "...",
# "identitySecretRing": "...",
# "blobPath": "/home/perkeep/var/perkeep/blobs",
# "packRelated": true,
@whacked
whacked / README.org
Last active June 20, 2018 08:42
quick and dirty word2vec server/client using flask, jsonrpc, gensim

RUNNING THE SERVER

python
python w2v.py server
go
go run w2v.go

QUERYING THE SERVER:

  • python client:
@whacked
whacked / README.org
Created March 25, 2018 04:07
example of cljs with externs using fuse.js
@whacked
whacked / project.clj
Created July 17, 2017 07:25
bare descjop with piggieback, sidecar, refactor-nrepl for use with clj-refactor
(defproject my-app "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"}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.473" :exclusions [org.apache.ant/ant]]
[org.clojure/core.async "0.2.395"]
[reagent "0.6.0"]
[ring/ring-core "1.5.1"]
@whacked
whacked / hosts
Last active June 19, 2017 07:49
spin up a xenial image with vnc
[all]
xenial-host
[all:vars]
ansible_user=vagrant
ansible_python_interpreter=/usr/bin/python3
ansible_port=2222
ansible_ssh_common_args='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
-- ref https://www.macosxautomation.com/applescript/sbrt/sbrt-06.html
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
@whacked
whacked / LaunchClojureRepl.java
Created November 21, 2016 08:12
minimal java to get a clojure repl server
// you will need the clojure jar AND the org.clojure.tools.nrepl jar for this
import clojure.java.api.Clojure;
import clojure.lang.IFn;
import clojure.lang.RT;
import clojure.lang.Keyword;
public class LaunchClojureRepl {
public static void main(String[] args) {
IFn require = Clojure.var("clojure.core", "require");
require.invoke(Clojure.read("clojure.tools.nrepl.server"));
@whacked
whacked / adaptive.sib
Created August 28, 2016 19:13
[dump] adaptive ui buttons test using Immutable / Mithril / sibilant
(scoped
;; adaptive button panel test
(def gen-panel (label action)
{ label: label
xlen: 1
ylen: 1
action: action })
(def calculate-strength (item-key world)
;; naive calculator, take previous usage time;