Skip to content

Instantly share code, notes, and snippets.

View robertlj's full-sized avatar

Robert Johnson robertlj

View GitHub Profile
@gdeer81
gdeer81 / oracle-db-update.clj
Last active July 11, 2018 16:57
an example of updating an oracle database from clojure the server, user names, and passwords have been changed to protect the innocent
(ns db-test.core
(:require [clojure.java.jdbc :as j])
(use [korma.db])
(use [korma.core])
(:gen-class))
(defn setup-connection []
(def oracle-db {:classname "oracle.jdbc.odbc.OracleDriver"
:subprotocol "oracle"
:subname "thin:@//remotehost:1521/derpina1"
@Chort409
Chort409 / gist:eb46f4d95261d9af51e9
Created November 26, 2014 03:33
Sql like join in clojure
(ns sql-like-join
(:require [clojure.set :refer [difference
intersection
union]]))
(defn inner-join
[left-keys right-keys]
(intersection (set left-keys) (set right-keys)))
(defn outer-join
@paf31
paf31 / 24days.md
Last active August 8, 2023 05:53
24 Days of PureScript

This blog post series has moved here.

You might also be interested in the 2016 version.

@oculushut
oculushut / JGit
Last active March 20, 2020 19:25
Using JGit in Windows
1. Download jgit.sh from here: https://eclipse.org/jgit/download/
(Yes -> it's a file with a .sh extension and we want to work in Windows, but download it!)
2. Rename the downloaded file to something easier to deal with. E.g. "jgit.sh"
3. Create a new file called jgit.bat and stick it in the same folder as jgit.sh.
4. Type the following into the jgit.bat file:
@andrewrk
andrewrk / 0tcp_server.zig
Last active July 25, 2022 23:17
zig vs node.js tcp server strace
const std = @import("std");
const event = std.event;
const mem = std.mem;
const assert = std.debug.assert;
pub fn main() !void {
const MyServer = struct {
tcp_server: event.TcpServer,
const Self = this;
@SneakyPeet
SneakyPeet / parse.clj
Created April 3, 2019 08:16
Parse fnb and ynab exoport csv
(defn parse-fnb [path]
(let [fnb-csv-rows
(as-> (slurp (clojure.java.io/file path)) x
(clojure.string/split x #"\n")
(drop 6 x)
(map #(clojure.string/split % #", ") x))
header (->> fnb-csv-rows first (map keyword))
rows (->> fnb-csv-rows
rest
(map #(zipmap header %))
@shanselman
shanselman / profile.json
Created May 7, 2019 04:22
Windows Terminal Profile
{
"defaultProfile": "{7d04ce37-c00f-43ac-ba47-992cb1393215}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"requestedTheme": "dark",
"profiles": [
{
@patrickpang
patrickpang / dt-clj.md
Created September 5, 2019 06:45
Data.table and Clojure

Data.table and Clojure

Background

This article compares the approaches of data manipulation using data.table in R and standard functions in Clojure, in order to evaluate the necessity of a Clojure library providing similar functionality of data.table. In the conceptual level, data.table provides a DSL in R specifically for data analysis, with a unified syntax similar to SQL for selecting, grouping, updating and joining tabular data. In contrast, the standard libraries of Clojure provide basic building blocks for general purpose, including persistent data structures (e.g. sequence, vector, set, map) and generic transformation functions (e.g. map, filter, reduce). This article aims to illustrate the impact of the two approaches on data manipulation using common use cases.

Load Dataset

The dataset used in this article is the NYC-flights14 data, which is On-Time flights data from the Bureau of Transporation Stati