Skip to content

Instantly share code, notes, and snippets.

@joefromct
joefromct / recur-with-atom.clj
Created Feb 11, 2019
can i remove the atom?
View recur-with-atom.clj
(def airplanes {:planes
{:plane
[{:make "Cessna",
:year "1977",
:model {:#text "MoonDart", :at-color "blue"},
:owner ["mitch" "glen" "paulie"],
:action
[{:#text "sample text - landed the plane and it was windy.",
:at-type "landing",
:at-weather "windy",
View read xlsx in py.py
from openpyxl import load_workbook
from toolz import thread_last, partition, partial
from typing import List, Dict
def __list_to_dict_list(all_rows: List[List]) -> List[Dict]:
headers, *rest = all_rows
return [dict(zip(headers, x)) for x in rest]
View arch.sh
# MY ARCH INSTALL GUIDE
# Change /dev/nvme**** to whatever drive/partitons you want
# This basically gets you to a GUI login
parted
# rm * # dunno if * will work but, delete all partitions
# mkpart ESP fat32 1MiB 513MiB
# set 1 boot on
# mkpart primary ext4 513MiB 50%
# quit
cryptsetup -y -v luksFormat /dev/nvme0n1p2 # setup encrypted container, set container password
View db-async-test.core-test.clj
(ns db-async-test.core-test
(:require [jdbc.core :as j] ;; this is the namespace for funcool/clojure.jdbc
;;[clojure.java.jdbc :as j]
[while-let.core :refer [while-let]]
[clojure.java.io :as io]
[clojure.data.csv :as csv]
[clojure.core.async :as a :refer [>! >!! <! <!! go-loop go chan thread]]
[clojure.string :as str]))
View node.readline.cljs
(ns cljs-utils.core
(:require [clojure.string :as str]
[cljs.nodejs :as nodejs]))
(nodejs/enable-util-print!)
(defn -main [& args]
(let [
readline (nodejs/require "readline")
View node.readline.js
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
rl.on('line', function (line) {
View recur.py
# given a list like this:
the_list = [1,2,3,4,5]
# We could call do_something() for each item in the list like this:
for li in the_list:
do_something(li)
@joefromct
joefromct / atom_clojure_setup.md
Created Dec 2, 2016 — forked from jasongilman/atom_clojure_setup.md
This describes how I setup Atom for Clojure Development.
View atom_clojure_setup.md

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

View postgres smartwrap sorta.sql
with
t as (select 'Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium'::text as t ),
select
t,
reverse(
regexp_replace((reverse(t::text)), E'(.{0,63} )(.*)' ,' \1 ') )
as test
from t
@joefromct
joefromct / ssh-multi.sh
Created Sep 14, 2016 — forked from dmytro/ssh-multi.sh
Start multiple synchronized SSH connections with Tmux
View ssh-multi.sh
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
You can’t perform that action at this time.