Skip to content

Instantly share code, notes, and snippets.

View hpcslag's full-sized avatar
🙀
Probability^C. not A and not B

MacTaylor hpcslag

🙀
Probability^C. not A and not B
  • Industrial Technology Research Institute.
  • Taiwan, Kaohsiung
View GitHub Profile
@hpcslag
hpcslag / Gauß.js
Created July 30, 2016 11:10
一個加總,各表自述
function sum(number) {
return (1 + number) * number / 2;
}
sum(1000);
@hpcslag
hpcslag / semantic-layout.html
Created May 31, 2016 14:06 — forked from thomd/semantic-layout.html
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@hpcslag
hpcslag / gist:069e230fa8e23fe0ae933daf4cde086c
Last active April 9, 2016 05:17
比賽表,兩筆資料從一張表搜尋(國家),一張表的兩筆資料,參照替換成第二張表的參考
SELECT G.Home, G.Away,
C1.CountryName, C2.CountryName
FROM Game G
JOIN Country C1 ON C1.CountryID = G.Home
JOIN Country C2 ON C2.CountryID = G.Away;
--http://stackoverflow.com/questions/4267929/whats-the-best-way-to-join-on-the-same-table-twice
@hpcslag
hpcslag / bigpipe.php
Created October 10, 2015 13:54 — forked from LeoOnTheEarth/bigpipe.php
Bigpipe Demo
<?php set_time_limit(0); ?>
<!DOCTYPE html>
<html lang="zh-tw">
<head>
<meta charset="utf-8" />
<title>BigPipe Demo</title>
</head>
<body id="main">
<div>
Hello world
@hpcslag
hpcslag / mongodb.js
Created April 9, 2015 14:10
Mongodb用法
/*
* This is Official API Note, use mongojs!
*/
var mongojs = require('mongojs');
var db = mongojs('test',['table']); //test 是db的名稱,不需要create. table是集合的名稱
/**
* Search All(Find())
* @class
@hpcslag
hpcslag / index.ejs
Last active August 29, 2015 14:16
WebRTC_Stream
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello World</title>
<script type="text/javascript" src="./socket.io/socket.io.js" ></script>
<script>
var socket = io('http://localhost');
socket.on('connect',function(){
console.log("Hello World");
@hpcslag
hpcslag / microphone.js
Created December 26, 2014 14:55
Need use localhost, don't use file:///
// success callback when requesting audio input stream
function gotStream(stream) {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var audioContext = new AudioContext();
var analyser = audioContext.createAnalyser();//x
// Create an AudioNode from the stream.
var mediaStreamSource = audioContext.createMediaStreamSource( stream );
// Connect it to the destination to hear yourself (or any other node for processing!)