Skip to content

Instantly share code, notes, and snippets.

View mc256's full-sized avatar
๐Ÿค—
follow the rabbit

Jun Lin (Michael) Chen mc256

๐Ÿค—
follow the rabbit
View GitHub Profile
<?php
// ๅœฐๅ€้…็ฝฎ
$iOSAPPStoreLink = '[iOS APP Store Link here]';
$AndroidLink = '[APK Link here]';
function redirect($url) {
header('Location: ' . $url);
exit();
}
@mc256
mc256 / bbcode.php
Last active August 29, 2015 14:20 — forked from neo22s/bbcode.php
<?php
/**
* BBcode helper class
*
* @package BBcode
* @category Helper
* @author Chema <[email protected]>
* @copyright (c) 2012
* @license GPL v3
*/
@mc256
mc256 / mediawiki.swift
Created October 3, 2015 19:50
mediawiki api swift handler
let pageRawData:NSData = try NSData(contentsOfURL: targetURL, options: [])
var tempData:NSDictionary = try NSJSONSerialization.JSONObjectWithData(pageRawData, options:.MutableContainers ) as! NSDictionary
tempData = tempData.objectForKey("query")!.objectForKey("pages") as! NSDictionary
tempData = tempData.objectForKey(tempData.keyEnumerator().nextObject()!) as! NSDictionary
let content = tempData.objectForKey("revisions")?.objectAtIndex(0).objectForKey("*") as! String
override func viewDidAppear(animated: Bool) {
let status = onWiFi()
print(status.check())
}
@mc256
mc256 / nginx.conf
Last active December 12, 2015 00:43
nginx cache server
proxy_cache_path /var/www/cache/moegirl levels=1:2 keys_zone=moegirlproxy:20M inactive=1y max_size=20g;
#่Œ็™พๅŽ‹ๅ›พๅๅ‘ไปฃ็†
server {
listen 80;
listen [::]:80;
server_name img.rabbitcdn.com;
limit_conn limit_addr 30;
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Random;
// Michael Chen
///////////////////////////////////
// Mux
///////////////////////////////////
//Mux 1-bit
module yMux1(z, a, b, c);
output z;
input a, b, c;
wire notC, upper, lower;
not my_not(notC, c);
and upperAnd(upper, a, notC);
@mc256
mc256 / BinarySearchTree.java
Last active July 21, 2016 04:17
EECS 2030 BinarySearchTree.java //try to remove a node has two childern
package quiz4;
import java.io.PrintStream;
import java.util.Scanner;
import quiz4.BinarySortedTree.Node;
/**
* This class encapsulates a binary search tree.
@mc256
mc256 / BinarySortedTree.java
Last active July 25, 2016 23:00
For EECS2030
package quiz4;
import java.util.Random;
import java.util.Scanner;
/**
* BinarySortedTree for EECS2030
*
* @author chen256
*
"details.scrollview.channel" = "่ฎข้˜…ๆธ ้“"; // ??????
"details.scrollview.errorreport" = "้”™่ฏฏๅ้ฆˆ"; // ??????
"p.t1" = "ๆ”พ้€ๆ็คบ"; // ??????
"p.n1" = "%@ ๆ”พ้€ไบ†ใ€Ž %@ ใ€็š„็ฌฌ%@้›†"; /*new episode*/
"push.want" = "ๆƒณ็œ‹"; // ??????
"push.watched" ๏ผ "ๅทฒ็œ‹"; // ??????