Skip to content

Instantly share code, notes, and snippets.

@maripiyoko
maripiyoko / gitcheats.txt
Created April 7, 2016 06:03 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# count relevant lines of shell code in a git repo
egrep -v '^\s*($|#)' $(git grep -l '#!/bin/.*sh' *) | wc -l
# push all remotes
for i in `git remote`; do git push $i; done;
# cherry pick range of commits, starting from the tip of 'master', into 'preview' branch
@maripiyoko
maripiyoko / gist:c8f66633e9cf1f2138d6
Created January 21, 2016 13:14 — forked from afeld/gist:5704079
Using Rails+Bower on Heroku

rbenvとruby-buildでRuby環境を最新に保つのんなー

更新日:2014/2/25

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
# ----- PROMPT -----
## PROMPT
PROMPT=$'[%*] → '
## RPROMPT
RPROMPT=$'`branch-status-check` %~' # %~はpwd
setopt prompt_subst #表示毎にPROMPTで設定されている文字列を評価する
# {{{ methods for RPROMPT
# fg[color]表記と$reset_colorを使いたい
# @see https://wiki.archlinux.org/index.php/zsh
<source>
type tail
path /home/jacopen/minecraft/data/vanilla/logs/latest.log
format /^\[.*\]\s\[.*\]:\s(?<log>.*)$/
time_format %d/%b/%Y:%H:%M:%S %z
tag minecraft.log
pos_file /var/log/td-agent/minecraft.pos
</source>
<match minecraft.log>
import java.io.PrintWriter;
import java.io.Writer;
import java.util.List;
import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;
import org.slim3.repackaged.org.json.JSONObject;
import org.slim3.util.StringUtil;
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')