Skip to content

Instantly share code, notes, and snippets.

Z. Liu zliuva

View GitHub Profile
View gist:bcc50bae22aac4dd424f
curl -Ss http://www.si.com/swimsuit/collection/2016 | egrep -o '/swimsuit/model/.+?/2016/photos' | parallel curl -Ss http://www.si.com{} | egrep '<img src=("[^"]+").+?class="image (?:Landscape|Portrait)"\s+/>' | egrep -o 'http://.+?\.jpg' | parallel wget {}
View gist:9086878
curl http://swimsuit.si.com/swimsuit/assets/json/data.min.json | perl -wnE 'say for /assets\\\/media\\\/gallery\\\/(?:\w+\\\/|)[\w\-]+\\\/op\d+-\d+-raw1200\.jpg/g' | sed 's/\\\//\//g' | sort | uniq | xargs -I {} wget "http://swimsuit.si.com/swimsuit/{}"
@zliuva
zliuva / hello.s
Created Jul 21, 2011
A simple Hello World for ARM on iOS
View hello.s
.text
.globl start
start:
mov r2, #14
adr r1, hello_str
mov r0, #1
mov r12, #4
swi 0x80
@zliuva
zliuva / gist:1084476
Last active Feb 27, 2019
A minimal Mach-o x64 executable for OS X
View gist:1084476
; A minimal Mach-o x64 executable for OS X (also see below Mountain Lion version)
;
; $ nasm -f bin -o tiny_hello tiny_hello.s
; $ chmod +x tiny_hello
; $ ./tiny_hello
; Hello World!
; $
; c.f.
; http://osxbook.com/blog/2009/03/15/crafting-a-tiny-mach-o-executable/ ( the original tiny mach-o executable )
@zliuva
zliuva / cpuid2.s
Created Jul 9, 2011
calling libc functions on OS X x64
View cpuid2.s
# cpuid2.s
# calling libc functions on OS X x64
#
# $ as -g -o cpuid2.o cpuid2.s
# $ ld -o cpuid2 -lc cpuid2.o
# $ ./cpuid2
# Vendor ID: GenuineIntel
# $
.data
@zliuva
zliuva / cpuid.s
Created Jul 8, 2011
An x86_64 OS X port of the cpuid example found in Ch. 4 of Professional Assembly
View cpuid.s
# cpuid.s
# An x86_64 OS X port of the cpuid example found in Ch. 4 of Professional Assembly Language
#
# $ as -o cpuid.o cpuid.s
# $ ld -o cpuid cpuid.o
# $ ./cpuid
# GenuineIntel
# $
.data
View gist:854408
for i in {1..48}; do wget `curl http://sportsillustrated.cnn.com/2011_swimsuit/models/brooklyn-decker/11_brooklyn-decker_$i.html | grep '<div id="cnnImage">' | sed 's/.*"\(.*\.jpg\)".*/\1/'`; done;
@zliuva
zliuva / fanfou.js
Created Dec 24, 2010
A node.js command line client for Fanfou.com
View fanfou.js
#!/usr/bin/env node
/**
* fanfou.js
* A node.js Fanfou client
* © 2010 softboysxp.com
*/
/**
* Copyright 2010 softboysxp.com. All rights reserved.
View gist:744954
curl -u <username>:<password> http://api.fanfou.com/statuses/friends_timeline.xml | grep '<text>' | sed 's/<text><\!\[CDATA\[//' | sed 's/\]\]><\/text>//' | sed 's/ //g'
You can’t perform that action at this time.