Skip to content

Instantly share code, notes, and snippets.

View xiangzhuyuan's full-sized avatar
🤗

Mathew P. Jones xiangzhuyuan

🤗
View GitHub Profile
@xiangzhuyuan
xiangzhuyuan / main.rb
Created March 12, 2014 15:59
ruby script lesson-1
class Student
attr_reader :id, :name, :age
def initialize(id, name, age)
@id = id
@name = name
@age = age
end
def id
@xiangzhuyuan
xiangzhuyuan / 三亚攻略 v2.0
Created March 13, 2014 06:25
三亚攻略 v 2.0
<h1 id="三亚攻略">三亚攻略</h1>
<h2 id="衣">衣</h2>
<pre><code>1. 拍照衣服搞定
2. 自由搭配 搞定
</code></pre>
<h2 id="食">食</h2>
---
tags: 三亚攻略
---
三亚攻略
===
@xiangzhuyuan
xiangzhuyuan / index
Created April 3, 2014 16:48
a new index html
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Test</title>
<link type="text/css" rel="stylesheet" href="asserts/jquery-ui-1.10.4.custom.css">
<!--<link type="text/css" rel="stylesheet" href="asserts/jquery.fancybox.css">-->
<link type="text/css" rel="stylesheet" href="asserts/bootstrap.css">
<link type="text/css" rel="stylesheet" href="asserts/photoswipe.css">
@xiangzhuyuan
xiangzhuyuan / 重庆游
Created May 27, 2014 15:32
重庆攻略
<h2 id="schedule">Schedule:</h2>
<blockquote>
<p>22:20 首都机场T3 00:55 江北机场T2 2014-05-31 SC1156 <br>
20:30江北机场T2A 23:05首都机场T2 2014-06-02 中国南方航空公司CZ8130</p>
</blockquote>
<p>住2晚;</p>
<blockquote>
@xiangzhuyuan
xiangzhuyuan / make-your-gem
Created July 20, 2014 14:26
创建你自己的gem
<h1 id="make-your-own-gem">make your own gem</h1>
<p><a href="http://guides.rubygems.org/make-your-own-gem/">从头到尾学习如果将自己的代码打包成gem</a></p>
<ul>
<li>Introduction</li>
<li>Your first gem</li>
<li>Requiring more files</li>
<li>Adding an executable</li>
<li>Writing tests</li>
@xiangzhuyuan
xiangzhuyuan / tumblr.css
Created August 12, 2014 03:44
a css for tumblr theme
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent
}
h1 a,h2 a,h3 a,h4 a,h5 a {
@xiangzhuyuan
xiangzhuyuan / rspec.rb
Last active August 29, 2015 14:05
I want to get know the initialize process of rspec
# the following snippt is script registered into command
#! ruby
#
# This file was generated by RubyGems.
#
# The application 'rspec-core' is installed as part of a gem, and
# this file is here to facilitate running it.
#
#!/usr/bin/env ruby_executable_hooks 这个有点意思哦!
#
# This file was generated by RubyGems.
#
# The application 'rspec-core' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
@xiangzhuyuan
xiangzhuyuan / activeresource_abc.rb
Last active August 29, 2015 14:06
学习 active resource ActiveSupport::JSON.decode(json)
def find(*arguments)
scope = arguments.slice!(0)
options = arguments.slice!(0) || {}
case scope
when :all then find_every(options)
when :first then find_every(options).first
when :last then find_every(options).last
when :one then find_one(options)
else find_single(scope, options)