Skip to content

Instantly share code, notes, and snippets.

View chuanxd's full-sized avatar

Timmy Chang chuanxd

View GitHub Profile
@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;
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@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')
@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>
@ceme
ceme / bash_curl_loop
Last active January 19, 2023 13:07
bash curl loop
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n\n'$(date);done
@paulirish
paulirish / gist:5558557
Last active April 18, 2024 14:32
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@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
@kevinSuttle
kevinSuttle / MDN custom search
Last active June 26, 2016 03:30
Custom Alfred search for Mozilla Developer Network
@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,