Skip to content

Instantly share code, notes, and snippets.

View devth's full-sized avatar
Hacking on @yetibot

Trevor Hartman devth

Hacking on @yetibot
View GitHub Profile
// reviewSummary is Option[ReviewSummary]
lazy val expertScoreCount = reviewSummary flatMap { rs =>
Option(rs.getExpertScoreCount) }
lazy val expertReviewList = reviewSummary flatMap { rs =>
Option(rs.getExpertReviews) }
lazy val expertAverageScore = reviewSummary flatMap { rs =>
Option(rs.getExpertAverageScore) }
highlight -w | xargs -I % -n1 sh -c 'echo %; highlight --out-format=xterm256 --style=% ProductPresenter.scala;'
@devth
devth / .gitconfig
Created June 27, 2012 16:43
git aliases
[alias]
st = status -sb
ci = commit
co = checkout
br = branch
sb = show-branch
dt = difftool
pu = push
cia = commit -a --amend
r = remote
@devth
devth / .zshrc
Created June 27, 2012 16:43
zshrc git aliases
# Git Aliases
alias gitr='cd `git root`'
alias gpr='git pull --rebase && git --no-pager hist @{1}.. && echo'
alias gpom='git push origin master'
alias gs="git status"
alias gp="echo 'Pushing commits:' && git --no-pager hist HEAD@{upstream}.. && echo '' && git push"
alias gd="git diff"
alias gds="git diff --shortstat"
alias gl="git log"
alias gk="gitx"
Counting objects: 43, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (29/29), done.
Writing objects: 100% (29/29), 2.95 KiB, done.
Total 29 (delta 22), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.pre
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
2012-06-23T17:20:15+00:00 app[web.1]: Started GET "/display/Bauhau5" for 174.24.131.76 at 2012-06-23 17:20:15 +0000
2012-06-23T17:20:15+00:00 app[web.1]: WARNING on line 111 of /app/app/assets/stylesheets/display.css.sass:
2012-06-23T17:20:15+00:00 app[web.1]: This selector doesn't have any properties and will not be rendered.
2012-06-23T17:20:23+00:00 app[web.1]: Processing by DisplayController#show as HTML
2012-06-23T17:20:23+00:00 app[web.1]: Parameters: {"store_name"=>"Bauhau5"}
2012-06-23T17:20:23+00:00 app[web.1]: Rendered shared/_qr_code.html.haml (3.2ms)
2012-06-23T17:20:23+00:00 app[web.1]: Rendered display/show.html.haml within layouts/display (11.2ms)
2012-06-23T17:20:23+00:00 app[web.1]: Compiled display.css (504ms) (pid 1)
2012-06-23T17:20:23+00:00 app[web.1]: Compiled lib/jquery.js (1ms) (pid 1)
2012-06-23T17:20:23+00:00 app[web.1]: Compiled lib/jquery.touchwipe.1.1.1.js (0ms) (pid 1)
scala> val pattern = """^(\d)+.*""".r
pattern: scala.util.matching.Regex = ^(\d)+.*
scala> val versionGood: Option[String] = Option("1.1.1")
versionGood: Option[String] = Some(1.1.1)
scala> val versionBad: Option[String] = Option(null)
versionBad: Option[String] = None
scala> versionGood match { case Some(pattern(d)) => Some(d); case _ => None }
dyld: Library not loaded: /usr/local/Cellar/gdbm/1.8.3/lib/libgdbm.3.0.0.dylib
Referenced from: /usr/local/bin/zsh
Reason: image not found
[Process completed]
mkdir ~/log-configs && git tag | while read tag; do mkdir ~/log-configs/$tag && git show $tag:./common/log-config.xml > ~/log-configs/$tag/log-config.xml;
@devth
devth / dominos.html
Created March 20, 2012 03:58 — forked from jacktandrew/gist:2131145
Create Dominoes
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<style>
div.tile {height: 70px; width: 35px; border-radius: 7px; float: left; margin: 10px;}
div.tile, div.bar {border: 2px outset #444;}
div.pips {height: 30px; width: 35px;position: relative; margin-top: 2px;}
div.pips div {border-radius: 5px; height: 4px; width: 5px; background: #333; position: absolute; border:2px inset #444;}