Skip to content

Instantly share code, notes, and snippets.

View Axure's full-sized avatar
😃
Time is money

Hu Zheng Axure

😃
Time is money
View GitHub Profile
@ezksd
ezksd / Interpreter.scala
Created March 11, 2017 09:05
interpreter
package ezksd
import ezksd.Parser.parse
object Interpreter {
type Continuation[T] = T => Unit
@inline
def cps_map(l: List[Any], f: (Any, Any => Unit) => Unit, k: Continuation[List[Any]]) {
@52cik
52cik / npm.taobao.sh
Last active February 29, 2024 02:56
npm 淘宝镜像配置
npm set registry https://r.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
template <typename Left, typename Right>
struct ConcatExpr;
template <typename Left, typename Right>
struct AltExpr;
template <typename SubExpr>
struct RepeatExpr;
template <char ch>
@guncha
guncha / relay.d.ts
Last active April 3, 2023 08:15
Very basic Relay typings for Typescript
declare module 'react-relay' {
// fragments are a hash of functions
interface Fragments {
[query: string]: ((variables?: RelayVariables) => string)
}
interface CreateContainerOpts {
initialVariables?: Object
prepareVariables?(prevVariables: RelayVariables): RelayVariables
@Axure
Axure / promises.md
Last active August 29, 2015 14:21 — forked from domenic/promises.md

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
:javascript
$(document).ready(function() {
window.loadIngredientSuggestionsEditor(#{@ingredients});
});
%h1 Edit ingredient suggestions
#js-ingredient-suggestions-editor
@oderwat
oderwat / aporia-hacked-to-osx.md
Created March 22, 2015 01:07
Hacking Aporia (Nim IDE) to work on Yosemite OS X with GTK 2 Quartz (no X11)

Aporia on OS X Yosemite (GTK+ 2.x)

"Don't try at home or don't blame me for lost hours of your life!"

See this Nim Forum Topic where this started.

Well I have a working Aporia version on my Yosemite OS X 10.10.2 from the new-suggest branch of the repository.

BUT the lengths I had to go to get this working are plastered with stuff I did not understand :)

@haskellcamargo
haskellcamargo / ParseWhile.hs
Created February 26, 2015 02:21
A While parser for Haskell with Parsec
module ParseWhile where
-- Import necessary libraries
import System.IO
import Control.Monad
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Language
import qualified Text.ParserCombinators.Parsec.Token as Token
@sameersbn
sameersbn / gitlab.conf
Created February 6, 2015 09:53
Nginx reverse proxy configuration for GitLab
upstream gitlab {
server 172.17.42.1:10080 fail_timeout=0;
}
# let gitlab deal with the redirection
server {
listen 80;
server_name git.example.com;
server_tokens off;
root /dev/null;
@yxdb
yxdb / p5
Last active August 29, 2015 14:12
Project 5: Diff
go to the 1st comment for the problem statement please. :)