Skip to content

Instantly share code, notes, and snippets.

# Jiyang.Liu
# 2012.7.22
src = $(wildcard *.c)
target = $(patsubst %.c, %, $(src))
CC = gcc
LDFLAGS = -Wall -g
all: $(target)
@luckyyang
luckyyang / convert.py
Created August 12, 2012 02:53
convert.py
#!/usr/bin/env python
"""This command use to import date from 2012-01-01 to your current date into a file with format csv/excel.
"""
import csv
import sys
import getopt
import datetime
from tempfile import TemporaryFile
from xlwt import Workbook
@luckyyang
luckyyang / meteor_camp_learning_path.md
Last active October 27, 2015 09:03
Meteor 项目孵化营 learning path
<button type="submit" class="btn btn-large btn-success" >
<i class="icon-user"></i> Sign in
</button>
btn-success
<br />
<button type="submit" class="btn btn-large btn btn-success" style="text-shadow: 0 0 0 rgba(0, 0, 0, 0.25);color:white;background: #80A337; ">
<i class="icon-user"></i> Sign in
</button>
#80A337;
<br />

Render and Redirect

The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render in a controller when we want to respond within the current request, and redirect_to when we want to spawn a new request.

Render

The render method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form' or render @post.comments, but here we'll focus on usage within the controller.

:action

@luckyyang
luckyyang / .vimrc
Created February 22, 2013 14:50
.vimrc backup
""""""""""""""""""""""""""""""""""""""""
"
" for macbook
"
""""""""""""""""""""""""""""""""""""""""
syntax on
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General Abbrevs
@luckyyang
luckyyang / fcitx_configuration
Last active December 14, 2015 16:38
fcitx configuration
1. 保证可以使用fcitx
在/etc/enviroment中输入(你看你少了什么,就添加什么就是了):
LANG="en_US.UTF-8"
LANGUAGE="en_US:en_GB:en"
LANG="en_US.UTF-8"
LANGUAGE="en_US:en_GB:en"
LC_CTYPE="zh_CN.UTF-8"
XMODIFIERS="@im=fcitx"
这样你就可以在英文界面上使用fcitx了;
@luckyyang
luckyyang / gitconfig
Last active December 19, 2015 23:28
my .gitconfig
[user]
name = Liu Jiyang
email = 2411mail@gmail.com
[core]
editor = vim
[push]
default = current
[branch]
autosetuprebase = always
[color]
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks