- Organizing larger applications
- Domain logic shouldn’t include handlers for bad/unclean data.
- validateur, bouncer, clj-schema for checking data going into the pipeline.
- domain-specific, semantic checks
- TODO: Any better ways for doing this conditional validation.
- Need to factor out common data cleaning utils into shared library.
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/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' |
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
using System; | |
using UnityEngine; | |
using UnityEditor; | |
public class CreateQuadMesh : Editor { | |
[MenuItem("Assets/Create/Quad Mesh", false, 10000)] | |
public static void Create () | |
{ | |
Mesh mesh = BuildQuad (1, 1); |
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 jme3-example.core | |
(:import com.jme3.app.SimpleApplication | |
com.jme3.material.Material | |
com.jme3.math.Vector3f | |
com.jme3.scene.Geometry | |
com.jme3.scene.shape.Box | |
com.jme3.texture.Texture)) | |
(defn application | |
"Create an jMonkeyEngine application." |
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 quadratic-residue.demo.core) | |
(defn follow [lookup-table] | |
(fn [n] | |
(loop [k n | |
edges {}] | |
(let [next-k (lookup-table k)] | |
(if (edges next-k) | |
edges | |
(recur next-k (assoc edges k next-k))))))) |
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 myupsert.core | |
(require [datomic.api :as d])) | |
(def schema | |
[ | |
{:db/id #db/id [:db.part/db] | |
:db/ident :product/name | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one | |
:db.install/_attribute :db.part/db} |
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
var tabbableElements = 'a[href], area[href], input:not([disabled]),' + | |
'select:not([disabled]), textarea:not([disabled]),' + | |
'button:not([disabled]), iframe, object, embed, *[tabindex],' + | |
'*[contenteditable]'; | |
var keepFocus = function (context) { | |
var allTabbableElements = context.querySelectorAll(tabbableElements); | |
var firstTabbableElement = allTabbableElements[0]; | |
var lastTabbableElement = allTabbableElements[allTabbableElements.length - 1]; |
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 zsh | |
git show-branch -a \ | |
| grep '\*' \ | |
| grep -v `git rev-parse --abbrev-ref HEAD` \ | |
| head -n1 \ | |
| sed 's/.*\[\(.*\)\].*/\1/' \ | |
| sed 's/[\^~].*//' | |
# How it works: |
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
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.0 |
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
# Mac preference changes: | |
# * minimize and hide dock | |
# * undo natural scrolling | |
# * max out keyboard repeat | |
# * increase desktop resolution | |
# * show date in menubar | |
# * do not play feedback when volume is changed | |
# * do not play user interface sounds | |
# * maximize mouse tracking speed |
OlderNewer