- http://stackoverflow.com/questions/3606591/why-does-intellij-idea-compile-scala-so-slowly/3612212#3612212
- https://gist.github.com/anonymous/1406238
- http://www.infoq.com/news/2011/11/yammer-scala
- http://grundlefleck.github.io/2013/06/23/using-scala-will-make-you-less-productive.html
- http://www.infoq.com/news/2011/11/scala-ejb2
- http://alarmingdevelopment.org/?p=562
- https://news.ycombinator.com/item?id=7458588
This file contains hidden or 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 bash | |
# pre-push hook to prevent push of certain branches to github.com | |
# copy this file to .git/hooks/pre-push | |
# and make it +x | |
REMOTE="$1" | |
URL="$2" | |
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" | |
FORBIDDEN_BRANCH="private" # change this to your private branch ... |
This file contains hidden or 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
package interfaces | |
import ( | |
"bufio" | |
"crypto/elliptic" | |
"crypto/tls" | |
"database/sql/driver" | |
"debug/dwarf" | |
"encoding/xml" | |
"fmt" |
This file contains hidden or 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
#!/bin/sed -rf | |
# How to run: | |
# echo 'A A<1+B1-C>B<1-A1+B>D<1-B1qC> 0<0>0' | |
# Note: Your local sed may use a different flag for "extended" regexes; this is written for GNU sed. | |
# | |
# tape: [active-state] " " (state-name "<" (write move next-state)_0 (write move next-state)_1 ">")* " " tape... "<" curpos ">" tape... | |
# State names can be any character not in " <>". | |
# The tape consists of 0's and 1's. | |
# The "move" field can be "-" to move left, "+" to move right, or "q" to halt. |
This file contains hidden or 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
package main | |
import ( | |
"compress/gzip" | |
"io" | |
"net/http" | |
"strings" | |
) | |
// Gzip Compression |
This file contains hidden or 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
,_---~~~~~----._ | |
_,,_,*^____ _____``*g*\"*, | |
/ __/ /' ^. / \ ^@q f | |
[ @f | @)) | | @)) l 0 _/ | |
\`/ \~____ / __ \_____/ \ | |
| _l__l_ I | |
} [______] I | |
] | | | | | |
] ~ ~ | | |
| | |
This file contains hidden or 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
import "bytes" | |
func StreamToByte(stream io.Reader) []byte { | |
buf := new(bytes.Buffer) | |
buf.ReadFrom(stream) | |
return buf.Bytes() | |
} | |
func StreamToString(stream io.Reader) string { | |
buf := new(bytes.Buffer) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# requires imagemagick and ffmpeg (tested with latest versions) | |
# make sure you set an INFILE variable first | |
# get GIF info | |
video=$(ffmpeg -i "$INFILE" 2>&1 /dev/null | grep "Video:"); | |
# get GIF Frames per second | |
fps=$(echo "$video" | sed -n "s/.* \([0-9.]*\) fps.*/\1/p"); | |
# a convinience variable so we can easily set FPS on the video |
I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.
- Publishing (Draft->Approved->Published->Expired->Deleted)