Skip to content

Instantly share code, notes, and snippets.

# directory-jumper {
# http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
export MARKPATH=$HOME/.marks
function j {
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
function j-mark {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function j-unmark {
var username = $(".add-user");
var avatar = username.parent().find(".avatar");
username
.asEventStream("keyup")
.map(function(event) { return $(event.target).val() })
.debounce(500)
.flatMapLatest(function(u) {
return Bacon.fromPromise($.ajax("https://api.github.com/users/" + u));
})
#!/bin/bash -e
DATE=$(date +"%d-%m-%Y-%H-%M-%S")
SCREENSHOT_PATH=~/Dropbox/Public/screenshots/screenshot-$DATE.png
DROPBOX_URL=https://dl.dropboxusercontent.com/u/1207191/screenshots/screenshot-$DATE.png
shutter --select --exit_after_capture --no_session --output $SCREENSHOT_PATH
echo $DROPBOX_URL | xclip -selection c
notify-send "Stored screenshot in dropbox"
package main
import (
"time"
)
func main() {
list := make([]int32, 60000000, 60000000)
for i := 0; i < 60000000; i++ {
list = append(list, int32(i))
export LAST_EXIT_CODE=$?
echo EXIT CODE: $LAST_EXIT_CODE
if [ $LAST_EXIT_CODE -ne 0 ]; then
exit 1
fi
Client version: 0.6.6
Go version (client): go1.2rc3
Git commit (client): 6d42040
Server version: 0.6.6
Git commit (server): 6d42040
Go version (server): go1.2rc3
Last stable version: 0.6.6
def starred_product? id
all_stars = stars
all_stars.any? {|star| star.product_id == id }
# stars.find_by_product_id(id).present?
end
Feature: Sidebar search
Scenario: Searchable categories
Given I have the categories "dogs, cats"
Then I see the categories "dogs, cats" in the category sidebar
When I use the sidebar category search to find "dogs"
Then I see the categories "dogs" in the category sidebar
Scenario: Searchable retailers
Given I have the categories "dogs, cats"
# rails {
# Make rails boot faster
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=100000000
export RUBY_HEAP_FREE_MIN=500000
# }