Query tickets in china
- Copy ticket.js and run it on your browser
- Install node.js
- Put package.json and server.js into a folder
- Copy a mp3 to the same forder and rename it to "alert.mp3"
| #Escape the 1.4GB V8 heap limit patch for Version 3.10.2 | |
| Usage: patch -p0 < v8.patch |
| //test browser "look-before-you-leap" (LBYL) request | |
| //expect is a header of HTTP/1.1 | |
| var http = require('http'); | |
| http.createServer(function(req,res){ | |
| console.log(req.header['user-agent'],req.header.expect); | |
| }); |
| <?php | |
| $size = pow(2, 16); // 16 is just an example, could also be 15 or 17 | |
| $startTime = microtime(true); | |
| $array = array(); | |
| for ($key = 0, $maxKey = ($size - 1) * $size; $key <= $maxKey; $key += $size) { | |
| $array[$key] = 0; | |
| } |
Query tickets in china
| var time = (+new Date) + 1000 * 60; | |
| process.nextTick(function w(){ | |
| if(+new Date < time) | |
| process.nextTick(arguments.callee) | |
| }); |
| (* | |
| Copyright (c) 2008, Christian Mittendorf <[email protected]> | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| Redistributions of source code must retain the above copyright notice, this | |
| list ofconditions and the following disclaimer. Redistributions in binary form | |
| must reproduce the above copyright notice, this list of conditions and the |
| .fake_file_input { | |
| background: url(../images/fake_file_input.png) no-repeat; | |
| cursor: pointer; | |
| width: 150px; | |
| height: 30px; | |
| overflow: hidden; | |
| position: relative; | |
| display: inline-block; | |
| *display: inline; | |
| *zoom: 1; |
| SubmitControl.prototype.submit = function() { | |
| var sXmlReq = ""; | |
| if (BSGetElementIgnoreError("TransID_New") != null) { | |
| this.addFieldByElementId("TransID_New"); | |
| } | |
| for (var i = 0; i < this.m_fields.length; i++) { | |
| var sName = (this.m_fields[i])[0]; | |
| var sValue = (this.m_fields[i])[1]; | |
| if ((sName != null) && (sValue != null)) { | |
| sValue = sValue.replace("%", "%25"); |
| function arg(type) { | |
| var r,t = Object.prototype.toString; | |
| [].forEach.call(arguments.callee.caller.arguments, function (a) { | |
| if (!r && t.call(arguments[0]).replace(/^[^\s]+\s([^\]]+)]/ig,"$1").toLowerCase() === type.toLowerCase()) r = a; | |
| }); | |
| return r; | |
| } |
| #!/bin/sh | |
| # ------------------------------------------------------------------------------ | |
| # SOME INFOS : fairly standard (debian) init script. | |
| # Note that node doesn't create a PID file (hence --make-pidfile) | |
| # has to be run in the background (hence --background) | |
| # and NOT as root (hence --chuid) | |
| # | |
| # MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
| # INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
| # INSTALL/REMOVE http://www.debian-administration.org/articles/28 |