Skip to content

Instantly share code, notes, and snippets.

View Ivlyth's full-sized avatar
🎯
Focusing

Ivlyth Ivlyth

🎯
Focusing
View GitHub Profile
@Ivlyth
Ivlyth / wzd.js
Created March 18, 2015 16:32
在查看 温州贷 - 给力标详情页的时候, 将投标纪录列表更换为图表显示, 需要配合 chrome 插件 tampermonkey 配合
// ==UserScript==
// @name WZD
// @namespace http://myth.ren
// @version 0.0.1
// @description just for learning
// @author Myth
// @match http://invest.wzdai.com/pagers/invest/detail_*.html
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// @require http://w.myth.ren/amcharts.js
@Ivlyth
Ivlyth / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Ivlyth
Ivlyth / js-date-format.js
Last active January 1, 2025 06:45
format javascript date to format "YYYY-mm-dd HH:MM:SS"
var d = new Date();
d = new Date(d.getTime() - 3000000);
var date_format_str = d.getFullYear().toString()+"-"+((d.getMonth()+1).toString().length==2?(d.getMonth()+1).toString():"0"+(d.getMonth()+1).toString())+"-"+(d.getDate().toString().length==2?d.getDate().toString():"0"+d.getDate().toString())+" "+(d.getHours().toString().length==2?d.getHours().toString():"0"+d.getHours().toString())+":"+((parseInt(d.getMinutes()/5)*5).toString().length==2?(parseInt(d.getMinutes()/5)*5).toString():"0"+(parseInt(d.getMinutes()/5)*5).toString())+":00";
console.log(date_format_str);
//2015-03-31 13:35:00
@Ivlyth
Ivlyth / work-env.sh
Last active August 29, 2015 14:19
work env
# InstallingCompilers see https://help.ubuntu.com/community/InstallingCompilers
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
gcc -v
make -v
# git
sudo apt-get install git
@Ivlyth
Ivlyth / install_qt.sh
Created April 18, 2015 08:36
install qt and pyqt on mac
# download qt
# more versions see : http://download.qt.io/archive/qt/
wget http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
# install qt
# see http://doc.qt.io/qt-4.8/install-x11.html
gunzip qt-everywhere-opensource-src-4.8.6.tar.gz
tar -xvf qt-everywhere-opensource-src-4.8.6.tar.gz
cd qt-everywhere-opensource-src-4.8.6
# type `o` for open source use, type `yes` to accept the license
make
@Ivlyth
Ivlyth / dig.example
Created April 21, 2015 11:29
pydig, wrap `dig` for ip information
myth@myth:~$ dig w.myth.ren
; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> w.myth.ren
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42119
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
@Ivlyth
Ivlyth / gist:e84f9b1ed50b9c632edb
Created April 29, 2015 09:24
register for freenode
https://freenode.net/faq.shtml#plusr
https://freenode.net/faq.shtml#nicksetup
https://freenode.net/faq.shtml#identify
@Ivlyth
Ivlyth / colorful.py
Created May 14, 2015 03:33
Print in terminal with colors using Python
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Author : myth
Date : 15-5-14
Email : belongmyth at 163.com
'''
Styles = dict(
list(zip(list(range(1, 9)),[
@Ivlyth
Ivlyth / install.sh
Created May 27, 2015 10:19
编译安装 subversion
下载 svn
wget http://ftp.tsukuba.wide.ad.jp/software/apache/subversion/subversion-1.8.13.tar.gz
查看根目录下的 INSTALL 文件
执行 ./autogen.sh
根据提示,下载 autoconf, libtool
脚本 http://w.myth.ren/rsync_mgr.py
rsync.conf
########## Global Config ##########
pid file = /home/myth/tmp/rsync/rsyncd.pid
lock file = /home/myth/tmp/rsync/rsync.lock
log file = /home/myth/tmp/rsync/rsync.log