Skip to content

Instantly share code, notes, and snippets.

View dinedal's full-sized avatar
👾

Paul Bergeron dinedal

👾
View GitHub Profile
@dinedal
dinedal / generate_static_dbt_docs.sh
Created September 26, 2019 18:30
Shell script that will generate a static copy of the dbt docs
#!/bin/bash
dbt docs generate
dbt docs serve &
DOCS_SERVER_PID=$!
sleep 2
until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:8080/); do
printf '.'
sleep 2
done
import re
class Trie():
"""Regex::Trie in Python. Creates a Trie out of a list of words. The trie can be exported to a Regex pattern.
The corresponding Regex should match much faster than a simple Regex union."""
def __init__(self):
self.data = {}
use phenom
include phenom/defs, phenom/configuration, phenom/job, phenom/log, phenom/sysutil
ph_library_init:extern func()
ph_nbio_init:extern func(Int)
ph_sched_run:extern func()
/* Strings */
export RUBY_CONFIGURE_OPTS="\
--with-readline-dir=$(brew --prefix readline) \
--with-openssl-dir=$(brew --prefix openssl)
--with-yaml-dir=$(brew --prefix libyaml) \
--with-gdbm-dir=$(brew --prefix gdbm) \
--with-libffi-dir=$(brew --prefix libffi)"
export GOPATH=$HOME/go
export EDITOR='subl'
# Case 1: raw values
DB[:foo].insert_sql(a:1)
# => "INSERT INTO \"foo\" (\"a\") VALUES (1)"
# Case 2: from another dataset
DB[:foo].insert_sql(DB[:foo].where(b:1))
# => "INSERT INTO \"foo\" SELECT * FROM \"foo\" WHERE (\"b\" = 1)"
# Case 3: raw values with conditionals
This example inserts some rows into table films from a table tmp_films with the same column layout as films:
```sql
INSERT INTO films SELECT * FROM tmp_films WHERE date_prod < '2004-05-07';
```
> DB[:foo].where(a:1).update_sql(b:2)
=> "UPDATE \"foo\" SET \"b\" = 2 WHERE (\"a\" = 1)"
> DB[:foo].where(a:1).insert_sql(b:2)
=> "INSERT INTO \"foo\" (\"b\") VALUES (2)"
triggit-clj-storm.core=> (-> "a b c" .toUpperCase (.replace "A" "X") first)
\X
triggit-clj-storm.core=> (->> "a b c" .toUpperCase (.replace "A" "X") first)
\A
Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
Maven home: /usr/local/Cellar/maven/3.0.4/libexec
Java version: 1.6.0_33, vendor: Apple Inc.
Java home: /Library/Java/JavaVirtualMachines/1.6.0_33-b03-424.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.8.2", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/Cellar/maven/3.0.4/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/paul/.m2/settings.xml
[DEBUG] Using local repository at /Users/paul/.m2/repository
@dinedal
dinedal / emacs.rb
Last active December 11, 2015 05:38
emacs 24 latest fullscreen patch
require 'formula'
class Emacs < Formula
homepage 'http://www.gnu.org/software/emacs/'
url 'http://ftpmirror.gnu.org/emacs/emacs-24.2.tar.bz2'
mirror 'http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.bz2'
sha1 '38e8fbc9573b70a123358b155cf55c274b5a56cf'
option "cocoa", "Build a Cocoa version of emacs"
option "srgb", "Enable sRGB colors in the Cocoa version of emacs"