View Editing Clojure with Emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check out README.md to get started editing Clojure with Emacs. |
View sexp-cheat-sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vimrc | |
" Map leader to comma | |
let maplocalleader="," | |
" Toggle this for vim-sexp to not go into insert mode after wrapping something | |
let g:sexp_insert_after_wrap = 0 | |
" Toggle this to disable automatically creating closing brackets and quotes | |
let g:sexp_enable_insert_mode_mappings = 1 | |
Vocab |
View gist:e5d1acbb007f47655508
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn keyword->pg-enum | |
"Convert a keyword value into an enum-compatible object." | |
[enum-type kw] | |
(doto (org.postgresql.util.PGobject.) | |
(.setType enum-type) | |
(.setValue (name kw)))) | |
(def ->status | |
"Convert a keyword status into a something_status enum object" | |
(partial keyword->pg-enum "something_status")) |
View gist:112904
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fastercsv' | |
task 'usda:import' => ['usda:import:food_items','usda:import:food_groups','usda:import:nutrients','usda:import:food_item_nutrients', 'usda:import:weights'] | |
namespace :usda do | |
namespace :import do | |
task :food_items => :environment do | |
puts "Importing Food Items..." | |
fname = File.join(RAILS_ROOT,"/db/usda_sr21/FOOD_DES.txt") |
View gist:112916
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fastercsv' | |
task 'usda:import' => ['usda:import:food_items','usda:import:food_groups','usda:import:nutrients','usda:import:food_item_nutrients', 'usda:import:weights'] | |
namespace :usda do | |
namespace :import do | |
task :food_items => :environment do | |
puts "Importing Food Items..." | |
fname = File.join(RAILS_ROOT,"/db/usda_sr21/FOOD_DES.txt") |
View .projections.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lib/*.ex": { | |
"type": "module", | |
"alternate": "test/{}_test.exs" | |
}, | |
"test/*_test.exs": { | |
"type": "test", | |
"alternate": "lib/{}.ex" | |
}, |
View ports.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
pattern=$1 | |
PORTS="" | |
if [ -z "$pattern" ]; then | |
PORTS=$(lsof -iTCP -sTCP:LISTEN) | |
else | |
PORTS=$(lsof -iTCP -sTCP:LISTEN | grep "$pattern") | |
fi |
View core.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns my-todo.core | |
(:require [io.pedestal.http :as http] | |
[io.pedestal.http.route :refer [router]] | |
[io.pedestal.http.route.definition :refer [defroutes]])) | |
(defn hello-world [context] | |
{:status 200 | |
:body "Hello, world!" | |
:headers {}}) |
View gist:7b22e66137da6ff5b46c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +rkneufeld is my blockchain ID. https://onename.com/rkneufeld |
NewerOlder