Skip to content

Instantly share code, notes, and snippets.

View jookyboi's full-sized avatar

Rui Jiang jookyboi

View GitHub Profile
@jookyboi
jookyboi / foobar.md
Last active February 18, 2019 16:35 — forked from rust-play/playground.rs
Code shared from the Rust Playground

ok

// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
#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)
//Here is a small script to automate the creation of a point light. It creates a point light with a connected Physical Light. Alternatively it connects a physical Light to the selected Lights.
proc string create_Physical_Light(int $interior){
string $sel_lights[] = `ls -sl -dag -leaf -lights`;
string $phyLight = `mrCreateCustomNode -asUtility "" physical_light`;
string $blackbody;
if ($interior) {
$blackbody = `mrCreateCustomNode -asUtility "" mib_blackbody`;
} else {
@jookyboi
jookyboi / Gemfile
Created September 20, 2013 01:40 — forked from leemour/Gemfile
source :rubygems
gem 'shotgun', :group=>:development
gem 'rack-cache'
gem 'sinatra', :require => 'sinatra/base'
gem 'sinatra-support'
gem 'haml'
ru:
devise:
confirmations:
confirmed: "Ваша учётная запись подтверждена. Теперь вы вошли в систему."
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
send_paranoid_instructions: "Если ваш адрес email есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
failure:
already_authenticated: "Вы уже вошли в систему."
inactive: "Ваша учётная запись ещё не активирована."
invalid: "Неверный адрес email или пароль."
=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')
:args `git grep -l .`
:argdo :%s/\s\+$//gc | w

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