Skip to content

Instantly share code, notes, and snippets.

View tstout's full-sized avatar

Todd Stout tstout

View GitHub Profile
@tstout
tstout / sku_parse.rb
Last active August 29, 2015 14:02
Convert sku csv to internal format
require 'csv'
def parse_shelf_color(val)
val.include?('Ivo') ? 'Sand' : 'Coffee'
end
def parse_shelf_dimensions(val)
dimensions = val
.gsub(/"/, '')
.gsub(/3\/4 h/, '')
@tstout
tstout / 0_reuse_code.js
Created June 27, 2014 12:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tstout
tstout / chg-pass.sql
Last active June 19, 2019 17:22
Oracle change passwod
--
-- Note: could not get this to work outside of sqlplus
-- also, no quotes around passwords. Weak passwords are not
-- allowed.
--
ALTER USER btstout IDENTIFIED BY new-pass replace old-pass
/
-- Note: This seems to no longer work. from sqlplus, simply type
@tstout
tstout / links.sql
Created June 27, 2014 15:27
Orale DB Links
@tstout
tstout / liquibase-schema.groovy
Last active December 14, 2022 20:08
Example of defining liquibase schema with groovy dsl #liquibase
package db.io
databaseChangeLog {
//
// Liquibase column types. Oddly enough, these are not mentioned in the docs, these were obtained from the source.
//
// "BIGINT"
// "NUMBER || "NUMERIC"
// "BLOB"
@tstout
tstout / fin-kratzen.clj
Created July 4, 2014 22:59
original kratzen attempt using html unit. OFX is a better alternative. Keeping this for posterity.
(ns kratzen.core
(:import (com.gargoylesoftware.htmlunit WebClient))
(:require [clojure.edn :as edn]
[clojure.java.io :as io])
(:use [clojure.tools.logging :only (info error)]))
(defn load-config []
(-> (io/file (System/getProperty "user.home"), ".fin-kratzen")
slurp
edn/read-string))
@tstout
tstout / new_gist_file.sql
Created August 5, 2014 15:45
refreshing a view in oracle
begin
DBMS_MVIEW.REFRESH('STOREORD.TCS_STORE_DIRECTIONAL_M', '?');
end;
/
@tstout
tstout / cli.clj
Last active August 29, 2015 14:07
minimal cli processing
(ns kratzen.cli
(:require [clojure.string :as st])
(:require [kratzen.server :refer :all])
(:use [clojure.string :only [replace-first]])
(:use [clojure.tools.logging :only (info error)]))
;;
;; Command line processing.
;;
;; I'm aware of tools.cli, however, I wanted to
@tstout
tstout / cli.clj
Created August 23, 2015 22:43
clojure-cli
(ns kratzen.cli
(:require [clojure.string :as st])
(:require [kratzen.server :refer :all])
(:use [clojure.string :only [replace-first]])
(:use [clojure.tools.logging :only (info error)]))
;;
;; Command line processing.
;;
;; I'm aware of tools.cli, however, I wanted to
@tstout
tstout / cli_test.clj
Created August 23, 2015 22:46
cli_test
(ns kratzen.cli-test
(:require
[kratzen.cli :refer :all]
[expectations :refer [expect]]))
;;
;; verify '--' creates a keyword
;;
(expect
:option