Skip to content

Instantly share code, notes, and snippets.

View jeremy5189's full-sized avatar

Jeremy Yen jeremy5189

View GitHub Profile
@jeremy5189
jeremy5189 / index.html
Created October 7, 2012 02:54
Animate
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>$title</title>
$styles
</head>
<body>
<h1>$title</h1>
var LINE = require('./line.js');
var line = new LINE();
var email = 'your email';
var password = 'your password';
line.login(email, password, function(error, result) {
if (error) {
return;
}
@jeremy5189
jeremy5189 / select.sql
Created March 6, 2013 14:48
Select Multiple Tables From SQL
# 注意,這種選擇方法得到的結果
# 一個 row 內會同時含有兩筆資料
# 建議先跑一遍試試看結果
SELECT *
FROM `twUniversity`, `twHighSchool`
WHERE `twUniversity`.`ipv4` LIKE '140%' AND `twHighSchool`.`ipv4` LIKE '203%'
ORDER BY `twUniversity`.`uid`, `twHighSchool`.`uid`;
<?php
/******** 登入畫面 login.php ********/
if(empty($_SESSION['login_success']))
$_SESSION['login_success'] = "";
if( $_SESSION['login_success'] == "true" )
{
header("Location: index.php");
@jeremy5189
jeremy5189 / gist:5805205
Created June 18, 2013 13:09
PHP Array Group By
<?php
$str = array("a","a","a","b","b","c","d","d","d");
foreach( array_count_values($str) as $item => $count ) {
for( $i = 0; $i < $count; $i++ ) {
echo $item."<br/>";
}
echo "<hr/>";
}
/*
* Author: Jeremy Yen Date: 2013.10.10
* http://oj.sslab.cs.nthu.edu.tw/problems/11
*
*/
#include <iostream>
#include <sstream>
using namespace std;
/*
* Author: Jeremy Yen Date: 2013.10.11
* http://oj.sslab.cs.nthu.edu.tw/problems/11
*
*/
#include <stdio.h>
#include <stdlib.h>
int main()
/*
* Fibonacci Sequence Application
* http://oj.sslab.cs.nthu.edu.tw/problems/12
* Authored by Jeremy Yen 2013.10.15
*/
#include <stdio.h>
#include <stdlib.h>
int main()
/*
* Occurrence Count
* http://oj.sslab.cs.nthu.edu.tw/problems/21
* Authored by Jeremy Yen 2013.11.11
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h> // 轉大寫
#define N 100
/*
* Hexadecimal Converter
* http://oj.sslab.cs.nthu.edu.tw/problems/23
* Authored by Jeremy Yen 2013.11.23
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h> // strlen()
#define N 10