Skip to content

Instantly share code, notes, and snippets.

View tigercosmos's full-sized avatar
💪
Feel free to reach me!

Liu, An-Chi tigercosmos

💪
Feel free to reach me!
View GitHub Profile
@kejyun
kejyun / javascript.date.timezone.trans.js
Created November 25, 2013 05:19
JavaScript 時間時區轉換
// 新增當地時區的時間物件
function DateTimezone(offset) {
// 建立現在時間的物件
d = new Date();
// 取得 UTC time
utc = d.getTime() + (d.getTimezoneOffset() * 60000);
// 新增不同時區的日期資料
@mplewis
mplewis / threePipeDemo.c
Created March 31, 2013 01:31
Here's an example of how to pipe three commands together using C. This one uses `ps aux | grep root | grep sbin`. This topic is horribly documented online so hopefully this'll help someone else out.
// This program is an example of how to run a command such as
// ps aux | grep root | grep sbin
// using C and Unix.
#include <stdlib.h>
#include <unistd.h>
int pid;
int pipe1[2];
int pipe2[2];