Skip to content

Instantly share code, notes, and snippets.

View phodal's full-sized avatar
🕶️
digging a new hole.

Fengda Huang phodal

🕶️
digging a new hole.
View GitHub Profile
@phodal
phodal / index.html
Created October 9, 2012 14:35 — forked from musart/index.html
web application for breakout.js client
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<style type="text/css">
body {
margin: 15px;
font-family: sans-serif;
@phodal
phodal / arduino-with-hc-sr04-lm35
Created February 13, 2014 12:10
arduino with hc-sr04 lm35
const int trigPin = 13;
const int echoPin = 12;
float temp;
int tempPin = 0;
void setup() {
Serial.begin(9600);
}
import pcd8544.lcd as lcd
import time, os, sys
import subprocess
if not os.geteuid() == 0:
sys.exit('Script must be run as root')
ON, OFF = [1, 0]
arg='ip route list'
@phodal
phodal / nginx.sh
Created September 2, 2014 05:33
Nginx compile with PageSpeed with cache_purge
./configure --user=www --group=www --add-module=../nginx-static-etags --add-module=../ngx_pagespeed-1.8.31.4-beta --add-module=../ngx_cache_purge --prefix=/usr/local/nginx --with-pcre --with-http_spdy_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-ipv6
@phodal
phodal / Q.js
Created November 24, 2014 23:51 — forked from guptag/Q.js Examples
//To run Q.js examples:
// 1. Open a new browser tab in Chrome and turn on developer toolbar.
// 2. Copy/Paste this gist in the console and hit enter to run all the snippets.
// Based on the inspiration from samples @ https://github.com/kriskowal/q
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
http://blog.new-bamboo.co.uk/2010/1/26/why-your-javascript-apps-need-more-structure
http://blog.new-bamboo.co.uk/2010/2/4/let-them-eat-state
http://blog.new-bamboo.co.uk/2010/3/7/the-js-model-layer
http://blog.new-bamboo.co.uk/2010/2/8/rendering-views-in-javascript
Controllers:
http://code.quirkey.com/sammy/ - Sammy is a tiny javascript framework built on top of jQuery. It’s RESTful Evented JavaScript.
@phodal
phodal / LICENSE
Last active August 29, 2015 14:13 — forked from mcollina/LICENSE
Copyright (c) 2008-2012 Nicholas O'Leary
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@phodal
phodal / es6proxy.htm
Created May 8, 2016 14:13 — forked from nzakas/es6proxy.htm
Example of ES6 Proxy
<!DOCTYPE html>
<!--
This is a simple experiment relying on ECMAScript 6 Proxies. To try this out,
use Aurora (http://www.mozilla.org/en-US/firefox/channel/).
The goal was to create a HTML writer where the method names were really just
the HTML tags names, but without manually creating each method. This uses
a Proxy to create a shell to an underlying writer object that checks each
method name to see if it's in a list of known tags.
@phodal
phodal / remove-bom.sh
Created May 17, 2016 01:54
Shell to Remove bom
find . -type f -exec sed -i -e '1s/^\xEF\xBB\xBF//' {} \;
@phodal
phodal / BeagleBoneLinuxUBootFromScratch.md
Created August 15, 2016 09:13 — forked from eepp/BeagleBoneLinuxUBootFromScratch.md
Building U-Boot and Linux 3.11 from scratch for the BeagleBone, and booting

Building U-Boot and Linux 3.11 from scratch for the BeagleBone, and booting

BeagleBone image

Introduction