Skip to content

Instantly share code, notes, and snippets.

View lingceng's full-sized avatar

Kexian Zhong lingceng

View GitHub Profile
@lingceng
lingceng / index.html.slim
Last active December 26, 2015 08:15
Export csv or excel by re-using existing HTML view
table
thead
tr
th = sort_link(@q, :number)
th = sort_link(@q, :production_status)
th = sort_link(@q, :current_step)
th = order_name(:production_type)
th = order_name(:type)
th = order_name(:brand)
th = order_name(:color)
@lingceng
lingceng / form_submit.js
Last active October 31, 2020 00:19
JavaScript request like a form submit
// http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit
// form_submit('/contact/', {name: 'Johnny Bravo'});
function form_submit(path, params, method) {
method = method || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
@lingceng
lingceng / README.md
Last active August 29, 2015 14:06 — forked from eric1234/README.md

A module to automatically translate snake_case method calls into CamelCase method calls. For example:

class MyObject
  include Snakeable
  
  def FooBar
    "baz"
  end

end

@lingceng
lingceng / gitconfig
Last active August 29, 2015 14:04
lingceng gitconfig
# out of date
# see https://github.com/lingceng/lingceng-config
[user]
name = zhongkx
email = zhongkx@reocar.com
[push]
default = simple
[alias]
st = status
ci = commit
@lingceng
lingceng / grep-operator.vim
Last active August 29, 2015 14:04
grep operator vim plugin, grep text recursily
" out of date
" see https://github.com/lingceng/lingceng-config
"
" Grep Operator Vim Plugin
"
" Description:
" Grep text recursively in current file and open the quickfix window.
"
" Install:
" Put this plugin here ~/.vim/plugin/grep-operator.vim
@lingceng
lingceng / vimrc_win
Created December 4, 2013 02:44
vimrc on windows, ctrlp.vim, indent
" ctrlp.vim
"
" cd D:/Vim/vimfiles
" git clone https://github.com/kien/ctrlp.vim.git bundle/ctrlp.vim
"
" :helptags D:\Vim\vimfiles\bundle\ctrlp.vim\doc
"
set runtimepath^=D:\Vim\vimfiles\bundle\ctrlp.vim
@lingceng
lingceng / vimrc (not maintained)
Last active June 6, 2017 07:43
vimrc with vundle, rails ctrp plugin and basic indent setting
" out of date
" see https://github.com/lingceng/lingceng-config
"
" lingceng vimrc
"
set nocompatible " be iMproved, required
filetype off " required
" vundle plugins ----------- {{{
" set the runtime path to include Vundle and initialize