Skip to content

Instantly share code, notes, and snippets.

View ETiV's full-sized avatar
🛥️
船迟又遇打头风

ETiV

🛥️
船迟又遇打头风
  • Shanghai, China
  • 23:35 (UTC +08:00)
View GitHub Profile
@ETiV
ETiV / db-mysql.js
Last active May 19, 2016 17:18
Node.JS mysql 数据库快速访问
/**
* Created by ETiV on 10/24/14.
*/
var mysql = require('mysql')
, config = require('./config');
/**
* config =
* {
mysql: {
@ETiV
ETiV / IRremote-fan-speed.ino
Created March 31, 2014 06:09
红外遥控器控制风扇转速. 红外信号针脚接11, 马达正极接6.
#include <IRremote.h>
int RECV_PIN = 11;
int MOTOR_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;
const int analogMin = 0;
const int analogMax = 255;
@ETiV
ETiV / QQYueTuan-SongList.json
Last active December 26, 2015 16:19
QQ乐团歌曲列表 / with keytype, 等级
[
{ idx: 1,
title: '上海之恋',
abbr: 'shanghaizhilian',
artist: '橘子焦糖',
offset: '0.098611',
bpm: '149',
'4k': { ez: 2, nm: 4, hd: 5 },
'5k': { ez: 2, nm: 4, hd: 6 } },
{ idx: 2,
@ETiV
ETiV / find_brother.js
Created September 11, 2013 09:04
给定一个数X,他的兄弟数Y定义为:是由X中的数字组合而成,并且Y是大于X的数中最小的。例如,38276的兄弟数字为38627。给定X,求Y。
var find_next_max = function (num) {
var _result = '', _arr = num.toString().split('');
// 从 _arr 里找到比 num 首位大的最小的数
// 因为 _arr 里的数字都是个位数, 所以返回 10 的话, 表示找不到
var find_number_larger_than_first_pos = function () {
var first, n = 10, _num;
for (var i in _arr) {
_num = parseInt(_arr[i]);
if (i == 0) {
@ETiV
ETiV / userscript-YouTube-Repeater.js
Created September 10, 2013 11:16
YouTube Repeater 的 UserScript 在YouTube上开启洗脑循环
// ==UserScript==
// @name YouTube Repeater
// @namespace ETiV
// @include http://www.youtube.com/watch?v=*
// @version 1
// ==/UserScript==
(function(){
var player = null, run_state = 0, repeat_state = false;
var btnTogglePlayState = document.createElement('button');
@ETiV
ETiV / GEOLite-Countries-Other.csv
Created September 4, 2013 18:15
IPList of other countries from GEO Lite
We can't make this file beautiful and searchable because it's too large.
"1.0.0.0","1.0.0.255","16777216","16777471","AU","Australia"
"1.0.4.0","1.0.7.255","16778240","16779263","AU","Australia"
"1.0.16.0","1.0.31.255","16781312","16785407","JP","Japan"
"1.0.64.0","1.0.127.255","16793600","16809983","JP","Japan"
"1.0.128.0","1.0.255.255","16809984","16842751","TH","Thailand"
"1.1.1.0","1.1.1.255","16843008","16843263","AU","Australia"
"1.1.64.0","1.1.127.255","16859136","16875519","JP","Japan"
"1.1.128.0","1.1.255.255","16875520","16908287","TH","Thailand"
"1.2.3.0","1.2.3.255","16909056","16909311","AU","Australia"
"1.2.128.0","1.2.255.255","16941056","16973823","TH","Thailand"
@ETiV
ETiV / GEOLite-Country-HongKong-HK.csv
Created September 4, 2013 18:13
IPList of HongKong from GEO Lite
1.32.0.0 1.32.255.255 18874368 18939903 HK Hong Kong
1.36.0.0 1.36.255.255 19136512 19202047 HK Hong Kong
1.64.0.0 1.65.255.255 20971520 21102591 HK Hong Kong
14.0.128.0 14.0.255.255 234913792 234946559 HK Hong Kong
14.1.20.0 14.1.23.255 234951680 234952703 HK Hong Kong
14.102.240.0 14.102.255.255 241627136 241631231 HK Hong Kong
14.136.0.0 14.136.255.255 243793920 243859455 HK Hong Kong
14.198.0.0 14.199.255.255 247857152 247988223 HK Hong Kong
27.50.32.0 27.50.39.255 456269824 456271871 HK Hong Kong
27.98.192.0 27.98.207.255 459456512 459460607 HK Hong Kong
@ETiV
ETiV / GEOLite-Country-TAIWAN-TW.csv
Created September 4, 2013 18:11
IPList of Taiwan from GEO Lite
1.34.0.0 1.35.255.255 19005440 19136511 TW Taiwan
1.160.0.0 1.175.255.255 27262976 28311551 TW Taiwan
1.200.0.0 1.200.255.255 29884416 29949951 TW Taiwan
14.0.56.0 14.0.56.255 234895360 234895615 TW Taiwan
14.0.63.0 14.0.63.255 234897152 234897407 TW Taiwan
27.51.0.0 27.53.255.255 456327168 456523775 TW Taiwan
27.96.224.0 27.96.255.255 459333632 459341823 TW Taiwan
27.100.64.0 27.100.127.255 459554816 459571199 TW Taiwan
27.105.0.0 27.105.255.255 459866112 459931647 TW Taiwan
27.123.200.0 27.123.207.255 461096960 461099007 TW Taiwan
@ETiV
ETiV / GEOLite-Country-China-CN.csv
Created September 4, 2013 18:07
IPList of China. from GeoLite
1.0.1.0 1.0.3.255 16777472 16778239 CN China
1.0.8.0 1.0.15.255 16779264 16781311 CN China
1.0.32.0 1.0.63.255 16785408 16793599 CN China
1.1.0.0 1.1.0.255 16842752 16843007 CN China
1.1.2.0 1.1.63.255 16843264 16859135 CN China
1.2.0.0 1.2.2.255 16908288 16909055 CN China
1.2.4.0 1.2.127.255 16909312 16941055 CN China
1.3.0.0 1.3.255.255 16973824 17039359 CN China
1.4.1.0 1.4.127.255 17039616 17072127 CN China
1.8.0.0 1.8.255.255 17301504 17367039 CN China
@ETiV
ETiV / flags_of_iTunes.txt
Created August 27, 2013 03:40
iTunes Flags are so beautiful
Region => The United States and Canada
Canada => https://s.mzstatic.com/images/flags/-dsi-50/can.png
United States => https://s.mzstatic.com/images/flags/-dsi-50/usa.png
Region => Europe
Albania => https://s.mzstatic.com/images/flags/-dsi-50/alb.png