Skip to content

Instantly share code, notes, and snippets.

View johnroyer's full-sized avatar

Zero Huang johnroyer

View GitHub Profile
--- Day changed Sat Aug 20 2016
01:06 < barneybook_mac> 應該都睡了吧
02:57 < chusiang> test ~ test ~~
02:57 < chusiang> 給所有還在趕進度的工作人員拍拍手 … (繼續忙了)
05:41 < Vdragon> 大家早安0w0/
06:51 < Heero_Yuy> 早安
07:12 < hashman> morning
07:23 < fntsrlike> Ping
07:36 < Vdragon> 太早到惹,被請去 MOS 吹冷氣QQ
07:39 < Heero_Yuy> …
--- Day changed Sun Aug 21 2016
00:05 <@chihchun> coscupbot: are you online?
00:06 < coscupbot> (chihchun) yes, I think you are.
00:06 <@chihchun> chusiang: https://gitter.im/COSCUP/coscup2016
00:18 < hashman> test
00:19 < hashman> test
00:21 < hashman> test
00:33 < wens> 哇... unconf竟然有 runtime PM... 會不會太硬啊
00:41 < chusiang> coscupbot: 戳戳 ~~
00:44 < coscupbot> (chusiang) chusiang pong.
var webduino = require('webduino-js');
var board = new webduino.WebArduino('xxxx');
var dht;
board.on('ready', function() {
dht = new webduino.module.Dht(board, board.getDigitalPin(10));
dht.read(function(e) {
var temperature = dht.temperature;
var humidity = dht.humidity;
}, 1000);
});
@johnroyer
johnroyer / init.sh
Created May 3, 2017 09:38
vultr startup script for Ubuntu16.04 php developer
#!/bin/sh
# time zone
timedatectl set-timezone Asia/Taipei
# user configure
mkdir -p /root/.ssh
@johnroyer
johnroyer / IPv4.php
Last active July 5, 2017 03:30
simple IPv4 checker (CIDR included)
<?php
declare(strict_types=1);
class IPv4
{
/**
* Check if input is a valid IPv4 address
*
* A valid IPv4 address is presents like `192.168.1.1`
@johnroyer
johnroyer / CapLocks2Ctrl.reg
Created July 13, 2017 00:17
Change CapsLocks to Ctrl for windows 7/10
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@johnroyer
johnroyer / resilio-sync
Created May 5, 2017 02:48
Resilio Sync config for ufw app
[ResilioSync]
title=Resilio Sync using Bittorent protocol
description=Sync data easily between devices
ports=3000/tcp|1900/udp|58610/udp|3838/udp|19717/tcp|50443/udp
@johnroyer
johnroyer / pure-config.php
Created September 15, 2017 05:52
env-config-comparison
<?php
$valid = [
'production' => '10.0.1.0/24',
'stage' => '10.0.1.0/24', // 和 production 重複
'dev' => '192.168.1.0/24',
];
@johnroyer
johnroyer / main.css
Created November 16, 2017 04:35
dark-theme for "Just Read" Chrome extension
@font-face {
font-family: 'Source Sans Pro Semibold';
src: url("chrome-extension://dgmanlpmmkibanfdgjocnabmcaclkmod/fonts/SourceSansPro-Semibold.ttf");
}
@font-face {
font-family: 'Source Sans Pro Bold';
src: url("chrome-extension://dgmanlpmmkibanfdgjocnabmcaclkmod/fonts/SourceSansPro-Bold.ttf");
}
@font-face {
font-family: 'Source Sans Pro Light';
@johnroyer
johnroyer / #coscup2014.log
Created July 20, 2014 15:29
COSCUP 2014 IRC log
--- Day changed Sat Jul 19 2014
00:17 < Guest10976> 請問沒有帶識別証 還有救嗎
00:18 < Guest10976> 各位大大救命呀
01:47 < S3p_lin> 嗯? 網站上面沒有 R0 R1 R2 H1 H2 H3 H4 的分布圖?
01:48 < wens> S3p_lin: R0 R1 R2 照舊吧
01:49 < wens> S3p_lin: 活動中心就是外面有摩斯那邊
01:53 < S3p_lin> wens: hmm
01:57 < wens> 竟然兩點了 明天爬不起來QQ
01:57 < Heero> 五點得搭統聯北上...
02:02 < shtzeng_tw> 最近特別累啊 orz