This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'socket' | |
include Socket::Constants | |
class ChatServer | |
def initialize | |
@reading = Array.new | |
@writing = Array.new | |
@clients = Hash.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FormView = Backbone.View.extend({ | |
el: '#form', | |
events: { | |
// Fired automatically when a file-type input is detected with a | |
// non-blank value. You can use this hook to implement a handler that | |
// will deal with those non-blank file inputs. Returning false will | |
// disallow standard form submission. | |
'ajax:aborted:file' : 'ajaxAbortedFile', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 只访问播放器页面 | |
javascript:location.href='https://secure.bilibili.tv/secure,cid='+document.getElementById('bofqi').childNodes[2].attributes.flashvars.value.split(/[=&]/)[1]; | |
// 替换优酷播放器,保留页面其他内容。将所有内容用void()包裹来防止页面刷新, 参考 http://www.ruanyifeng.com/blog/2011/06/a_guide_for_writing_bookmarklet.html | |
javascript:void(document.getElementById('bofqi').innerHTML='<iframe width="950" scrolling="no" height="482" frameborder="no" onload="window.securePlayerFrameLoaded=true" framespacing="0" border="0" src="####" class="player"></iframe>'.replace("####",'https://secure.bilibili.tv/secure,cid='+document.getElementById('bofqi').childNodes[2].attributes.flashvars.value.split(/[=&]/)[1])); | |
var cid = document.getElementById('bofqi').childNodes[2].attributes.flashvars.value.split(/[=&]/)[1]; | |
var url = 'https://secure.bilibili.tv/secure,cid=' + cid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |