Skip to content

Instantly share code, notes, and snippets.

@kliu
kliu / batch_delete_repos.md
Last active August 13, 2021 04:19
Batch delete repos
  1. Create token with repo and delete repo scope, https://github.com/settings/tokens
  2. Install github command line tools. https://cli.github.com/manual/
  3. List repos gh repo list --fork --limit 500 > repos.txt
  4. echo "USER=kliu\nTOKEN=123\n" > clean.sh
  5. cat repos.txt| awk '{printf "curl -XDELETE -u ${USER}:${TOKEN} https://api.github.com/repos/"$1"\n"}' >> clean.sh
@kliu
kliu / IPTV
Created January 7, 2021 12:08 — forked from liu246542/IPTV
Lust for life
#EXTM3U
#EXTINF:-1, group-title="中央频道", CCTV-3
http://223.110.245.165/ott.js.chinamobile.com/PLTV/3/224/3221225588/index.m3u8
#EXTINF:-1, group-title="中央频道", CCTV-5
http://223.110.245.165/ott.js.chinamobile.com/PLTV/3/224/3221226362/index.m3u8
#EXTINF:-1, group-title="中央频道", CCTV-7
http://121.31.30.90:8085/ysten-business/live/cctv-7/1.m3u8
#EXTINF:-1, group-title="中央频道", CCTV-8
http://121.31.30.90:8085/ysten-business/live/cctv-8/1.m3u8
#EXTINF:-1, group-title="中央频道", CCTV-9

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

So yesterday brought the sad news that Google Reader is being killed off. C’est la vie it seems, given it was a Google product. In my search for an alternative I rediscovered Fever and decided to see if I could run it up for free on Heroku. Onwards...

Personally I think the news about Reeder is quite sad, as I would quite happily have paid for it as a service. In fact I like RSS so much that I actually shelled out the $30 for Fever when it first came out years ago (I was also pretty massive Shaun Inman fanboy if I’m being honest).

I ended up setting Fever aside because screw having to manage self-hosting for PHP and MySQL, right?

If you’re new to Fever I recommend going and checking it out, but also reading the post in response to the Google Reader announcement by Fevers author, Shaun, for a good list of what Fever is and isn’t.

Enough jibba-jabba!

@kliu
kliu / wropper-example.md
Created October 12, 2012 08:51
Examples for PDF conversion
@kliu
kliu / gist:2310014
Created April 5, 2012 11:14 — forked from al3xandru/gist:1128606
nvALT Bookmarklet
javascript:(function({
var INSTAPAPER=true,w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="From ["+pageTitle+"]("+pageUri+"):\n\n";
if(pageSelectedTxt!="") {
pageSelectedTxt=">%20"+pageSelectedTxt;
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");
w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle)
}
else {
@kliu
kliu / gist:1333384
Created November 2, 2011 10:52
mongodb-error
Wed Nov 2 17:56:44 [initandlisten] connection accepted from 127.0.0.1:49234 #1
Wed Nov 2 17:56:45 [conn1] command admin.$cmd command: { listDatabases: 1 } ntoreturn:1 reslen:338 813ms
Wed Nov 2 17:56:46 [conn1] admin.system.namespaces Assertion failure isOk() db/pdfile.h 300
0x10007d703 0x100087eec 0x1004165e4 0x10040774b 0x100410823 0x100437df9 0x1004b3006 0x100426693 0x100426b53 0x100429f45 0x10042d8f0 0x10043109e 0x10043353b 0x10043662a 0x1004a13ca 0x1003d5e0f 0x1003e298a 0x100603394 0x100148d8c 0x10060a554
0 mongod 0x000000010007d703 _ZN5mongo12sayDbContextEPKc + 195
1 mongod 0x0000000100087eec _ZN5mongo8assertedEPKcS1_j + 300
2 mongod 0x00000001004165e4 _ZN5mongo11DataFileMgr9getExtentERKNS_7DiskLocE + 148
3 mongod 0x000000010040774b _ZN5mongo11DataFileMgr7findAllEPKcRKNS_7DiskLocE + 75
4 mongod 0x0000000100410823 _ZN5mongo13findTableScanEPKc
@kliu
kliu / Debuger.java
Created January 13, 2011 14:04
Make your own Prism Debuger by JPDA/JDI
package test;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import com.sun.jdi.Bootstrap;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.Value;
import com.sun.jdi.VirtualMachine;
For VCS
1. Add <category name="ipv6"/>
2. Change <item name="IP">::</item> for <category name="MRCPSRV">
For SIPMethod
1. Change kernel.ms.rmi.address=:: in sipenv.properties
2. Change <NetworkAccessPoint transport="tcp/udp" address="::" port="5060"/>