Skip to content

Instantly share code, notes, and snippets.

View jookyboi's full-sized avatar

Rui Jiang jookyboi

View GitHub Profile
@jookyboi
jookyboi / GuessNumber.java
Created December 20, 2012 02:45 — forked from brikis98/GuessNumber.java
Some java files
import java.util.Random;
import java.util.Scanner;
public class GuessNumber {
public static void main(String[] args) {
Random generator = new Random();
int toGuess = generator.nextInt(10) + 1;
int guess;
Scanner scanner = new Scanner(System.in);
try {
@jookyboi
jookyboi / imap_idle.rb
Created March 18, 2013 19:32 — forked from jem/gist:2783772
Implement IMAP idle in Ruby.
SERVER = 'imap.gmail.com'
USERNAME = 'XXX'
PW = 'XXX'
require 'net/imap'
require 'net/smtp'
require 'tmail'
require 'maruku'
def to_markdown(text)
Maruku.new(text).to_html
@jookyboi
jookyboi / bucket_policy.json
Created March 25, 2013 01:36 — forked from masnick/gist:1654182
S3 bucket policy for static website hosting.
{
"Version": "2008-10-17",
"Id": "b2cc31d0-cc91-4285-a658-473099d2c867",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
{
"code": 0,
"msg": "OK",
"info": {
"list": [
{
"appid": "141",
"appname": "云存储",
"apkname": "mobi.w3studio.android.apps.eyuntv",
"Img1": "http://amsfile.tv189.cn:8082/autofs/amsupload/amsupload/images/20130327/13643632896669.png",

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after

Shared Clipboard: vim,tmux,macos

One clipboard to rule them all. Requires tmux >= 1.8. Thanks @thoughtbot

Tell vim to use the system clipboard:

" ~/.vimrc
set clipboard=unnamed " use the system clipboard
:args `git grep -l .`
:argdo :%s/\s\+$//gc | w
=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')
ru:
devise:
confirmations:
confirmed: "Ваша учётная запись подтверждена. Теперь вы вошли в систему."
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
send_paranoid_instructions: "Если ваш адрес email есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
failure:
already_authenticated: "Вы уже вошли в систему."
inactive: "Ваша учётная запись ещё не активирована."
invalid: "Неверный адрес email или пароль."