Skip to content

Instantly share code, notes, and snippets.

View liango2's full-sized avatar
🌴
On vacation

liango2

🌴
On vacation
View GitHub Profile
@liango2
liango2 / git.md
Created November 7, 2015 18:47 — forked from suziewong/git.md
github的多人协作?how to 贡献代码?

github的多人协作

  1. github上你可以用别人的现成的代码 直接 git clone 即可了

  2. 然后你也想改代码或者贡献代码咋办?

Fork

@liango2
liango2 / readme.mkd
Created December 5, 2015 19:07 — forked from yuest/readme.mkd
Lisp 之根本 - blogist.yue.st

大名鼎鼎的 Paul Graham 写过一篇《The Roots of Lisp》,讲解他对 Lisp 根源的理解。这篇文章我在很多年前就试图阅读,但是都不大能读懂,直到去年年末时候我读了几十年前的 Lisp 1.5 手册的相关部分,终于算是理解了。再读一遍 pg 的文章,也就完全能懂了。现在结合自己的理解尝试把这些概念重述一遍。这篇文章就是想以自己的话语阐述一遍这些基本概念。这里会偏重于数学式的思维训练而不是实用性的程序编写,所以和实际情况会稍有出入。计划写两部分,第一部分是7个原始操作,第二部分讲实现 Lisp 解释器。

在 lisp manual 里面,我看到 John 使用了一种数学人很喜欢的表述方式,就是先定义符号和规则,然后在这套规则下让我们来看看我们可以怎么玩。有一点数学基础的人可能就会觉得这样理解会很容易。

##基本定义

首先定义符号,为了简化,我在这篇文章里就定义可用的符号26 个小写字母、10个数字、空格、左右圆括号和单引号

然后我们定义原子(atom),原子就是由字母和数字组成序列并且只能由字母开头,比如 abc123,比如 foo 或 bar 都是原子。

@liango2
liango2 / seesaw-repl-tutorial.clj
Created December 10, 2015 06:29 — forked from daveray/seesaw-repl-tutorial.clj
Seesaw REPL Tutorial
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@liango2
liango2 / bs3-login-form.html
Created December 21, 2015 17:34 — forked from bMinaise/bs3-login-form.html
Bootstrap 3 - Login Form Example From: http://bootsnipp.com
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
@liango2
liango2 / assert
Created December 30, 2015 13:28 — forked from maximn/assert
Scala preconditions
val rnd = Math.random()
val n = Math.abs(rnd)
assert(n > 0)
@liango2
liango2 / SCombinator.scala
Created January 13, 2016 19:19 — forked from folone/SCombinator.scala
Y-Combinator in Scala
/**
* <b>Fixed Point Combinator is:</b>
* Y = λf.(λx.f (x x)) (λx.f (x x))
*
* <b>Proof of correctness:</b>
* Y g = (λf . (λx . f (x x)) (λx . f (x x))) g (by definition of Y)
* = (λx . g (x x)) (λx . g (x x)) (β-reduction of λf: applied main function to g)
* = (λy . g (y y)) (λx . g (x x)) (α-conversion: renamed bound variable)
* = g ((λx . g (x x)) (λx . g (x x))) (β-reduction of λy: applied left function to right function)
* = g (Y g) (by second equality) [1]
@liango2
liango2 / aVeryBigSum.scala
Created January 14, 2016 18:24
A Very Big Sum
object Solution {
def main(args: Array[String]) {
val sc = new java.util.Scanner(System.in);
var n = sc.nextInt();
var arr = new Array[Int](n);
for (arr_i <- 0 to n - 1) {
arr(arr_i) = sc.nextInt();
}
println(arr.map(_.toLong).sum)
@liango2
liango2 / DiagonalDifference
Created January 14, 2016 18:29
DiagonalDifference
object Solution {
def main(args: Array[String]) {
val sc = new java.util.Scanner(System.in);
var n = sc.nextInt();
var a = Array.ofDim[Int](n, n);
for (a_i <- 0 to n - 1) {
for (a_j <- 0 to n - 1) {
a(a_i)(a_j) = sc.nextInt();
}
@liango2
liango2 / PlusMinus.scala
Created January 14, 2016 21:04
统计给定Array[Int]数组中正数, 负数, 0所占的比, 依次(正数, 然后负数,然后0)打印结果,使用小数表示即可
object Solution {
def main(args: Array[String]) {
val sc = new java.util.Scanner (System.in);
var n = sc.nextInt();
var arr = new Array[Int](n);
for(arr_i <- 0 to n-1) {
arr(arr_i) = sc.nextInt();
}

This is an adaptation of https://twitter.com/jasonneylon script.

In the terminal window, you can open your current repo (at the current branch) in your default browser.

My adaptation was adding options to view the commits, branches, pull requests or issues for the repo using one of the additional options (added support for wiki, settings, pulse, graphs, network):

[h]               => View help
[c]               => View commits
[c {SHA}]         => View specific commit from commit SHA

[b] => View branches