Skip to content

Instantly share code, notes, and snippets.

@redswallow
redswallow / hs.md
Created December 26, 2011 22:35 — forked from jackywyz/hs.md
Haskell练习

###haskell 基本类型,bool,list,tuple,int,Integer,Double,char ,string,function

  1. 编译运行
  • runhaskell hell.hs
  • ghc --make helloworld and then ./helloworld
  1. let/in 在函数的应用
root s = 
 let p = 2
o 打开关闭文件或者目录
t 在标签页中打开
T 在后台标签页中打开
! 执行此文件
p 到上层目录
P 到根目录
K 到第一个节点
J 到最后一个节点
u 打开上层目录
m 显示文件系统菜单(添加、删除、移动操作)
\documentclass[12pt]{article}
\pagestyle{headings}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{dsfont}
\usepackage{graphicx}
\usepackage[paperwidth=8.5in,% %%
paperheight=11in,% %%
outer=1.1in,% %%
inner=1.1in,% %%
@redswallow
redswallow / github-organizations.md
Last active December 15, 2016 23:51
A collection of open-source repositories of big companies.
##plugin
###python_fold http://www.vim.org/scripts/script.php?script_id=515
zo: 打开光标位置的折叠代码
zc: 折叠光标位置的代码
zr: 将文件中所有折叠的代码打开
zm: 将文件中所有打开的代码折叠
zR: 作用和 zr 类似,但会打开子折叠(折叠中的折叠)
zM: 作用和 zm 类似,但会关闭子折叠
zi: 折叠与打开操作之间的切换命令
Python code snippets
C++ code snippets
Haskell code snippets
Cracking the coding interview, careercup
Data Structures
1. Integer
– find number of 1s
– next largest smaller
– smallest larger number
– determine if is palindrom
– itoa, atoi
@redswallow
redswallow / gist:6052bbaf8987dbaafba2
Created April 23, 2015 19:45
remove STUPID auto-generated song lists created by Douban
$(".songlist li").each(function(){
var pic = $(".songlist-pic", this).css("background-image");
// remove song lists with default cover only
if (pic.indexOf("cover_default") > -1) {
// get sid of the song list
var sid = $(".delete-sl-btn", this).data("sid");
$.post_withck('/j/songlist/uncollect', {
songlist_id : sid
}, function(res){
var res = $.parseJSON(res);