Skip to content

Instantly share code, notes, and snippets.

View jcouyang's full-sized avatar
🈚
💢

Jichao Ouyang jcouyang

🈚
💢
View GitHub Profile
@jcouyang
jcouyang / ob-clojure.el
Created May 22, 2015 03:40
babel clojure execute with cider support
;;; ob-clojure.el --- org-babel functions for clojure evaluation
;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
;; Author: Joel Boehland
;; Eric Schulte
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;; This file is part of GNU Emacs.

name: inverse layout: true class: center, middle, inverse

#并发,core.async 和 JavaScript .footnote[http://git.io/js-csp]


layout: false

@jcouyang
jcouyang / stop-asking.el
Last active June 29, 2020 14:01
disable emacs asking following git symbolink
; 当要打开一个symbolink的时候,如果symbollink到一个被git(或者其他vc)管理的文件时,emacs老问
; Symbolic link to Git-controlled source file; follow link? (y or n)
; 配置下这个变量就好了
(setq vc-follow-symlinks nil)
; nil 表示 不要问,no
; ask 表示每次都问
; t 表示follow
@jcouyang
jcouyang / Stop_build_if_PR.sh
Last active June 15, 2020 02:03
make Bamboo support Github Pull Request with Status API
#!/bin/bash
if [[ -n ${bamboo_pull_num} ]]; then
echo 'stoping bamboo'
curl "http://${bamboo_BAMBOO_USER}:${bamboo_BAMBOO_password}@your.bamboo.domain/build/admin/stopPlan.action?${bamboo.planResultKey}-${bamboo.buildNumber}"
fi
@jcouyang
jcouyang / react-tips.md
Last active October 24, 2015 13:33
some tips about React

React Tips

如果把每个Component想象成一个函数,那么props就是这个函数的参数。在有类型检查的语言中,很容易在编译期间就可以对参数类型检 查来避免一些不必要的错误。

javascript没有类型检查,但是我们仍然能筒高React的Prop Validation在运行期间检查props的类型。

只需要在Component声明里加上

propTypes: {
@jcouyang
jcouyang / travis-variables.sh
Last active August 29, 2015 14:13
The Useful Globel Environment Variables on Travis ci machine
TRAVIS_TEST_RESULT=0
TRAVIS_COMMIT=e7090ffc4ef844d1a066a34037c913b429d7dc2a
TRAVIS_OS_NAME=linux
TRAVIS_LANGUAGE=node_js
TRAVIS=true
@jcouyang
jcouyang / clean-mac-download-log.md
Last active August 29, 2015 14:09
清空 mac 历史下载记录

mac 记录了你的所有下载记录

sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent'

> sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent'
http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/20.0/mac/en-US/Firefox%2020.0.dmg
http://download.sparrowmailapp.com/appcast/Sparrow-latest.dmg
@jcouyang
jcouyang / emacs-24-4.md
Last active August 29, 2015 14:08
emacs 24.4 新特性

安装

brew install emacs --cocoa --with-glib

新特性

superword-mode

这个对于编程非常的有用, 比如以前的 subword-mode, 可以把 CamelCase 当成一个词. 但是下划线的单词还是会当成几个单词.

那么superword-mode 就解决了这一问题. 只需要设置成1就开启了.

@jcouyang
jcouyang / ansi-term.ti
Last active March 30, 2016 18:08
fix weird charactor 4m in emacs ansi-term
eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
#
# The code here is forced by the interface, and is not subject to
# copyright, constituting the only possible expression of the algorithm
# in this format.
#
# When updating this file, etc/e/eterm-color should be regenerated by
# running "make e/eterm-color" in the etc directory.
# Any change to this file should be done at the same time with a
# corresponding change to the TERMCAP environment variable in term.el.
@jcouyang
jcouyang / 3-reason-to-use-jest-to-test-your-javascript.md
Last active March 24, 2019 13:58
用 jest 轻松测试 JavaScript

Javascript 的测试, 不管在用 jasmine 还是 mocha, 都是很头疼的事情. 但是自从有了 jest, 一口气写7个测试, 腰也不疼了, 头也不疼了.

只需要 3 个理由

在说用 jest 测为什么好之前,我们先来看我们要测的一个例子.