Skip to content

Instantly share code, notes, and snippets.

@sprhawk
sprhawk / 12306.user.js
Created January 5, 2012 10:29 — forked from quietlynn/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
NSArray * strings = [text componentsSeparatedByString:@"@"];
if([strings count] == 2) {
NSString * string = [strings objectAtIndex:0];
NSCharacterSet * set = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.-"];
set = [set invertedSet];
if ([string length]) { //@之前不是空字串
range = [string rangeOfCharacterFromSet:set];
if (NSNotFound == range.location) { //只包含合法字符
string = [strings objectAtIndex:1];
if ([string length]) { //@之后不是空字串
<canvas id="canvas" style="position:absolute; top:0; left:0;"></canvas>
<div id="buffer" style="display:none;">
@sprhawk
sprhawk / CMakeLists.txt
Created December 22, 2016 16:01 — forked from nocnokneo/CMakeLists.txt
VTK Rendered to an FBO in a Qt Quick 2 Scene Graph
cmake_minimum_required(VERSION 2.8.11)
project(VtkFboInQtQuick)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})