Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am stevenyxu on github.
* I am stevenxuca (https://keybase.io/stevenxuca) on keybase.
* I have a public key whose fingerprint is CDE4 3E21 B230 3957 684E E4AF 6EC2 D557 8079 201C
To claim this, I am signing this object:
DROP TABLE IF EXISTS sessions;
DROP TABLE IF EXISTS events;
DROP TABLE IF EXISTS userCookies;
DROP TABLE IF EXISTS users;
CREATE TABLE sessions (
sessionID INT,
userHTTPCookie INT,
datetime TIMESTAMP,
IPAddress TEXT,
var page = require('webpage').create();
page.open('http://myfigurecollection.net/', function(status) {
var srcs = page.evaluate(function() {
var imgs = document.querySelectorAll('img');
var l = imgs.length;
var res = [];
for (var i = 0; i < l; i++) {
res.push(imgs[i].src);
}
return res;
@stevenyxu
stevenyxu / index.html
Last active August 29, 2015 14:14
Font Awesome
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<i class="fa fa-spinner fa-spin"></i>
<i class="fa fa-circle-o-notch fa-spin"></i>
<i class="fa fa-refresh fa-spin"></i>
<i class="fa fa-cog fa-spin"></i>
<i class="fa fa-spinner fa-pulse"></i>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<i class="fa fa-spinner fa-spin"></i>
<i class="fa fa-circle-o-notch fa-spin"></i>
<i class="fa fa-refresh fa-spin"></i>
<i class="fa fa-cog fa-spin"></i>
<i class="fa fa-spinner fa-pulse"></i>
@stevenyxu
stevenyxu / Product List
Last active August 29, 2015 14:09
Tatcha API
$ curl 'http://api.tatcha.com/shop/api/rest/products?page=1&limit=3&order=name&dir=asc' -H "Accept: text/xml"
<?xml version="1.0"?>
<magento_api>
<data_item>
<entity_id>314</entity_id>
<sku>GOLD-TUMBLER-GP</sku>
<name>24-Karat Gold Leaf Tumblers</name>
<short_description>&lt;p&gt;You'll be the host's favorite with such an elegant and tasteful gift. Purchasing for yourself? Bravo. You'll have the daily benefit of seeign something beautiful in your cabinets every time you peek inside. Set of Two.&lt;/p&gt;</short_description>
<description>&lt;div&gt;Sharing a drink is symbolic of celebration, gathering and friendship. These special glasses, made exclusively for TATCHA by expert artisans in Shizuoka near Mt. Fuji, combine three cherished forms of Japanese craftsmanship &amp;mdash; handmade washi paper (set at the base); gold-leafing and urushi lacquering on the exterior. Each one is a piece of art, hand-crafted to last for generations.&amp;nbsp;&lt;/div&gt;&#xD;
&lt;div&gt;&amp;nbsp;&lt;/di
@stevenyxu
stevenyxu / gist:9943182
Created April 2, 2014 21:06
keybase.md
### Keybase proof
I hereby claim:
* I am cairo140 on github.
* I am stevenxuca (https://keybase.io/stevenxuca) on keybase.
* I have a public key whose fingerprint is CDE4 3E21 B230 3957 684E E4AF 6EC2 D557 8079 201C
To claim this, I am signing this object:
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('check', function() {
grunt.log.writeln('Checking!');
});
grunt.registerTask('buildFoo', function() {
grunt.log.writeln('Building Foo!');
});
grunt.registerTask('buildBar', function() {
grunt.log.writeln('Building Bar!');
Current item schema is up-to-date with version 5ABD0782.
S_StartSound: Failed to load sound 'ui\notification_alert.wav', file probably missing from disk/repository
] ] dota_local_custom_enable 1;dota_local_custom_game Frota;dota_local_custom_map Frota;dota_force_gamemode 15;update_addon_paths;dota_wait_for_players_to_load 0;dota_wait_for_players_to_load_timeout 10;map riverofsouls;Can't change replicated ConVar dota_l
Unknown command "]"
Unknown command "Can"
DrawElement: shader UnlitGeneric doesn't have a snapshot state for drawing
---- Host_NewGame ----
Missing map material: nodraw
TraceRayVerticalGroundHeight() disabled for 'maps/riverofsouls.bsp'
TraceRayVerticalGroundHeight() disabled for 'maps/riverofsouls.bsp'
@stevenyxu
stevenyxu / find_pairs.rb
Created November 11, 2013 07:09
Find pairs of numbers in an array that add to 100
# Find pairs that sum to 100
# Input: [13, 2, 14, 3, 13, 97, 13] -> [[3, 97]]
# [1, 99, 1, 99] -> [[1, 99], [1, 99]]
# [50, 50, 50, 50, 50] -> [[50, 50], [50, 50]]
def find_pairs(p_array)
array = p_array.dup
sum = 100
res = []
while first_num = array.shift