Skip to content

Instantly share code, notes, and snippets.

View dingmingxin's full-sized avatar
🎯
Focusing

EverDing dingmingxin

🎯
Focusing
View GitHub Profile
#!/bin/bash
#
# Build and iPhone Simulator Helper Script
# Shazron Abdullah 2011
#
# WARN: - if your .xcodeproj name is not the same as your .app name,
# this won't work without modifications
# - you must run this script in where your .xcodeproj file is
PROJECTNAME=$1
@dingmingxin
dingmingxin / tmux.conf
Created July 16, 2016 01:17
dmx-tmux.conf
# -- general -------------------------------------------------------------------
set -g default-terminal "xterm-256color" # colors!
set-option -g default-shell /bin/zsh
setw -g xterm-keys off
set -s escape-time 0 # fastest command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s quiet on # disable various messages
@dingmingxin
dingmingxin / README.md
Created January 17, 2017 06:47 — forked from Jxck/README.md
libuv TCP server/client sample

how to compile

$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices server.c -o server
$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices client.c -o client
@dingmingxin
dingmingxin / libuv-tcp-client.c
Created January 17, 2017 07:29 — forked from snatchev/libuv-tcp-client.c
a libuv evented tcp client
#include <stdio.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static uv_loop_t *loop;
static uv_buf_t alloc_cb(uv_handle_t* handle, size_t size) {
--[[ config
root = "./"
listen = "127.0.0.1:8786"
redisaddr = "127.0.0.1:6379[1]"
dbfile = root .. "backup.db"
thread = 4
logger = nil
harbor = 1
@dingmingxin
dingmingxin / host1.nginx.conf
Last active March 28, 2017 05:58
openresty_luapath_multihosts
# virtual host2 conf
server {
listen 80;
server_name host1.xxx.com;
# Access log with buffer, or disable it completetely if unneeded
access_log host1/logs/access.log combined buffer=16k;
error_log host1/logs/error.log;
# lor runtime
@dingmingxin
dingmingxin / unpack_plist.py
Created April 16, 2017 08:41 — forked from wonkwh/unpack_plist.py
extract image from plist,png file created by texturepacker
#/usr/local/bin/python
import os,sys
from xml.etree import ElementTree
from PIL import Image
def tree_to_dict(tree):
d = {}
for index, item in enumerate(tree):
if item.tag == 'key':
if tree[index+1].tag == 'string':
@dingmingxin
dingmingxin / glm_kazmath.diff
Created July 28, 2017 09:26 — forked from fhssn1/glm_kazmath.diff
Some examples of equivalence of OpenGL math libraries glm (C++) and kazmath (C)
--- p6.cpp 2014-03-28 22:55:37.000000000 -0500
+++ p6.c 2014-03-28 23:02:28.000000000 -0500
@@ -7,9 +7,8 @@
#define PNG_DEBUG 3
#include <png.h>
-#include <glm/glm.hpp>
-#include <glm/gtc/matrix_transform.hpp>
-#include <glm/gtc/type_ptr.hpp>
+#include <kazmath/kazmath.h>
@dingmingxin
dingmingxin / README.md
Created August 25, 2017 07:09 — forked from aldur/README.md
Emoji to JSON

Emoji to JSON

A simple Python script to extract unicode emojis from this page and store their details in a JSON file. Additionally, it also extract the emoji images as PNG files.

Usage

Store the page:

@dingmingxin
dingmingxin / lpegxml.lua
Created August 25, 2017 08:09 — forked from aperezdc/lpegxml.lua
Fairly complete LPeg grammar for parsing XML
--
-- LPeg-based XML parser.
--
-- * Grammar term names are the same as in the XML 1.1
-- specification: http://www.w3.org/TR/xml11/
-- * Action functions are missing.
--
-- Copyright (C) 2012 Adrian Perez <aperez@igalia.com>
-- Distribute under terms of the MIT license.
--