Skip to content

Instantly share code, notes, and snippets.

View erning's full-sized avatar
🌴
On vacation

Zhang Erning erning

🌴
On vacation
View GitHub Profile
@erning
erning / flappy-bird.js
Last active June 30, 2020 02:06
Flappy Bird - code.org GameLab
var FLYING_SPEED = -3;
var GRAVITATIONAL_ACCELERATION = 0.5;
//
// background
//
var backgrounds = [
createSprite(World.width*0.5, World.height*0.5-28),
createSprite(World.width*1.5, World.height*0.5-28)
@erning
erning / ne
Created April 12, 2015 13:48
ne - node execute
#!/bin/bash
PATH="$(npm bin):$PATH" exec "$@"
@erning
erning / safari-mobile-note.md
Created September 19, 2014 02:25
iOS Web Application

[iOS Developing Web Content for Safari][1]

缺省图标

在 htdocs 目录下放置:/apple-touch-icon.png

页面中设置图标

在 HTML 文档中设置

@erning
erning / aps.php
Created April 30, 2014 02:00
PHP APS Client
<?php
/**
* Creates an APS client and returns the handler.
*
* @param $spID string
* @param $spVer string
* @param $sender string
* @return The APS client handler on success or false on failure.
*/
\documentclass...
\usepackage {xeCJK}
\setmainfont{Optima}
\setsansfont{Optima}
\setmonofont{Menlo}
\setCJKmainfont[BoldFont={BiauKai}]{BiauKai}
\setCJKsansfont[BoldFont={BiauKai}]{BiauKai}
\setCJKmonofont{PMingLiU}
\XeTeXlinebreaklocale "zh"
//
// $ gcc -std=c99 glowpz.c -o glowpz
//
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
const uint32_t ORIGIN = 0x0CCCC; // 0 1100 1100 1100 1100
const uint32_t TARGET = 0x05A5A; // 0 0101 1010 0101 1010
@erning
erning / README.md
Last active January 11, 2020 22:57
isolated ansible installation

still running from source

$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ virtualenv .virtualenv
$ source .virtualenv/bin/activate
$ pip install paramiko PyYAML jinja2
zone "twitter.com" IN {
type forward;
forward only;
forwarders {
74.207.241.5;
74.207.242.5;
};
};
# bash_completion
complete -o bashdefault -o default -o nospace -c ve
@erning
erning / path.go
Created December 17, 2012 08:26 — forked from sp3c73r2038/path.py
golang
/*
put this script in the path like
assumed /tmp (cwd)
/tmp/dir1/dir2/path.go
/tmp/dir3 symlinked to /tmp/dir1/dir2
and run with
gorun ../tmp/dir3/path.go
or build path.go and run with ../tmp/dir3/path