Skip to content

Instantly share code, notes, and snippets.

View chuanxd's full-sized avatar

Timmy Chang chuanxd

View GitHub Profile
@tony1223
tony1223 / sample.html
Created April 20, 2013 06:29
prototype practice sample
<html>
<head>
<title></title>
</head>
<body>
<input type="button" id="test" value="clickme" />
<div id="output" ></div>
<table id="test_table">
<tr><td>test1</td></tr>
<tr><td>test2</td></tr>
@kevinSuttle
kevinSuttle / MDN custom search
Last active June 26, 2016 03:30
Custom Alfred search for Mozilla Developer Network
@gslin
gslin / twitterToPlurk.pl
Last active August 10, 2017 03:49
Plurk 新版 OAuth Core 1.0a 的 twitter to plurk
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Data::UUID;
use DBI;
use HTTP::Request::Common;
use LWP::Simple;
@clonn
clonn / scapeCostco.js
Created October 16, 2017 10:29
擷取 costco 商品資料,如果商品沒有貨, result 的結果會是已售完
var request = require('request');
var cheerio = require('cheerio');
var url = 'https://www.costco.com.tw/Baby-Care-Kids-Toys/Toys/Infant-%26-Preschool/VTech-Sit-To-Stand-Ultimate-Alphabet-Train/p/105123';
request(url, function(err, res, body){
var $ = cheerio.load(body);
var result = $('.stock-status').text().trim();
@UnableRegister
UnableRegister / curl.md
Last active October 25, 2018 15:26
curl #curl

CURL

查看网页源码

curl url

保存

  • curl -o [文件名] url

自动跳转

curl -L url

@ihower
ihower / gist:6132576
Last active June 12, 2019 05:42
Git commit without commit
# First commit
echo "hello" | git hash-object -w --stdin
git update-index --add --cacheinfo 100644 ce013625030ba8dba906f756967f9e9ca394464a hello.txt
git write-tree
git commit-tree aaa96c -m "First commit"
git update-ref refs/heads/master 30b060d9a7b5e93c158642b2b6f64b2b758da40d
# Second commit
@phith0n
phith0n / README.md
Last active December 23, 2019 11:15
『代码审计』小密圈入圈指南

『代码审计』小密圈入圈指南

加入代码审计小密圈: https://wx.xiaomiquan.com/mweb/views/joingroup/join_group.html?group_id=2212251881

代码审计小密圈从去年11月成立至今已有近半年时间,一直没有把我们的宗旨和规则明文写出来,一是我比较懒事儿也比较多,二是我发现大家都是善良的小纯白,并没有谁是揣着恶意来到这里,所以这个事儿也不是特别急。但一直没有成文的规定总不是办法,有的新人进来后,四顾何茫茫,不领要旨,可能会觉得钱花的不值。

宗旨

办这个圈子,脑子里有几句话,我一直奉为圭臬,在这里说一下。

@GavinJoyce
GavinJoyce / gist:4f81d0bf879dad6b203e
Last active November 20, 2020 04:01
speeding up `npm install` by disabling the progress bar
with `react-native`:
npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 83.72s user 26.03s system 100% cpu 1:49.32 total
npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 199.30s user 27.32s system 91% cpu 4:08.29 total
--
@carbontwelve
carbontwelve / curl_example.php
Created March 27, 2014 13:54
PHP Curl to check if url is alive
<?php
function check_alive($url, $timeout = 10, $successOn = array(200, 301)) {
$ch = curl_init($url);
// Set request options
curl_setopt_array($ch, array(
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_NOBODY => true,
CURLOPT_TIMEOUT => $timeout,
@r37r0m0d3l
r37r0m0d3l / dataset from event.js
Created November 15, 2012 11:08
javascript get dataset from event
// as property
event.currentTarget.dataset.id
// as array element
event.currentTarget.dataset['id']
// jquery method
$(event.currentTarget).data('id')