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" = "已看"; // ??????