Skip to content

Instantly share code, notes, and snippets.

View htoooth's full-sized avatar
🎯
Focusing

htoooth htoooth

🎯
Focusing
View GitHub Profile
const globalData = getApp()._options.globalData;
const HPage = (lifeCycle) => {
const { onInit: _onInit, build: _build, onDestroy: _onDestroy } = lifeCycle
return Object.assign(lifeCycle, {
onInit(param) {
if (param) param = JSON.parse(param);
this.state = param || {};
this.globalState = globalData.localStorage || {};
_onInit &&

Getting Started with Clojure on Windows

Clojure is an amazingly powerful language. Using it (and watching Rich Hickey videos) has changed the way I think about programming, and the way I code in general. Once I learned the basics of the language, which was a relatively quick process, I fell in love and couldn't look back. I hope this post can help others who are new to Clojure get up and running quickly and painlessly.

This post is opinionated in the sense that I'll suggest certain tools to help those who are new to this scene get on their feet. The things you'll need are:

  • Leiningen (pronounced LINE-ing-en) - This is like a package manager, build tool, task manager, and more in one tool. Think npm or nuget, but with more capabilities. There is at least one other build tool for Clojure (boot), but Leiningen is the most widely used.
  • JDK - Clojure runs on Java. Throw out any qualms you have about Java, we aren't coding in Java (though we can through Clojure, and sometimes that ca
@htoooth
htoooth / proxy.js
Last active June 28, 2017 10:06
proxy
/**
* Created by TaoHuang on 2017/6/28.
*/
const http = {
websocket: {}
};
function readPack(con) {
return con.read();
@htoooth
htoooth / jQuery-plugin-authoring.md
Created July 1, 2016 09:39 — forked from quexer/jQuery-plugin-authoring.md
如何编写 jQuery 插件

创建插件


看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。

开始

@htoooth
htoooth / proxy.go
Created February 20, 2016 13:17 — forked from wallrat/proxy.go
Simple GO TCP proxy
package main
import (
"net"
"fmt"
"io"
"os"
)
func main() {
if len(os.Args) != 3 {
fatal("usage: netfwd local remote")
@htoooth
htoooth / proxy.go
Created February 20, 2016 13:17 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@htoooth
htoooth / frp.md
Created January 13, 2016 14:56 — forked from ohanhi/frp.md
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Foreword

# gdal for python binding reference : http://pcjericks.github.io/py-gdalogr-cookbook/index.html
# more gdal for python information come from gdal autotest for python binding.
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
databaseServer = "***.***.***.***"
databaseName = "postgis"
databaseUser = "postgres"
public static class RecordExtensions
{
private static class Cache<T>
{
public static Func<IDataRecord,int, T> Get;
}
static RecordExtensions()
{
using UnityEngine;
using System.Collections;
public class Assert {
public static void Test(bool condition,System.Func<string> strf){
if (!condition) {
Debug.LogError(strf());
Debug.Break();
}