Skip to content

Instantly share code, notes, and snippets.

🎯
Currently focused on the needs of Google Chrome

Victor Costan pwnall

🎯
Currently focused on the needs of Google Chrome
Block or report user

Report or block pwnall

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d47582382fa69d2a6cd8
def no_repeats(year_start, year_end)
no_repeats=[]
(year_start..year_end).each do |yr|
no_repeats<<yr if no_repeat?(yr)
end
no_repeats
end
def no_repeat?(year)
num_seen=[]
View gist:4056e1e94f8694d0fd12
### Keybase proof
I hereby claim:
* I am pwnall on github.
* I am pwnall (https://keybase.io/pwnall) on keybase.
* I have a public key whose fingerprint is 1CC4 CD57 EF01 392D 1DDF 2531 0C58 7774 D23E 223B
To claim this, I am signing this object:
@pwnall
pwnall / clocks.html
Created Nov 28, 2013
Experiment that measures the drift between the V8 clock and the Blink clock.
View clocks.html
<!DOCTYPE html>
<script>
// Maximum difference between Blink's clock and V8's.
var maxDelta = 0;
// Measure clock differences for 30 seconds.
//
// Browsers will stop our JavaScript if it runs for too long without returning
@pwnall
pwnall / time.html
Created Nov 28, 2013
Experiment for proving that Date.now() goes back quite often by quite a bit in V8 on Windows.
View time.html
<!DOCTYPE html>
<script>
// Watch out for the clock going backwards for 30 seconds.
//
// Browsers will stop our JavaScript if it runs for too long without returning
// control to the event loop.
var smallTest = function() {
var startTime = Date.now();
@pwnall
pwnall / google_form_voter.rb
Created Oct 6, 2013
Mechanizing a Google Form
View google_form_voter.rb
require 'mechanize'
loop do
agent = Mechanize.new
agent.user_agent_alias = 'Mac Safari'
puts "Fetching form"
page = agent.get "https://docs.google.com/forms/d/15a7OlkEn9qDCxyG23a4ilS6SRa0c61p4el222OFqRAk/viewform"
@pwnall
pwnall / ll_test.rb
Created Sep 14, 2013
Test whether a Ruby VM has the hooks we need to implement label propagation for Police.
View ll_test.rb
class LabeledString < String
def +(other)
LabeledString.new original_plus(other)
end
end
class String
alias_method :original_plus, :+
def +(other)
@pwnall
pwnall / gist:5523050
Created May 6, 2013
middleman-sprockets crashes middleman 3.1.beta (and master)
View gist:5523050
/home/pwnall/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/middleman-sprockets-e5806151a349/lib/middleman-sprockets/sass_function_hack.rb:18:in `image_url': undefined local variable or method `sprockets_context' for #<Sass::Script::Functions::EvaluationContext:0x0000000153c9f0> (NameError)
(in /home/pwnall/workspace/mm-sprockets/source/stylesheets/all.css.sass)
from /home/pwnall/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sass-3.2.8/lib/sass/script/funcall.rb:112:in `_perform'
from /home/pwnall/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sass-3.2.8/lib/sass/script/node.rb:40:in `perform'
from /home/pwnall/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sass-3.2.8/lib/sass/tree/visitors/perform.rb:298:in `visit_prop'
from /home/pwnall/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sass-3.2.8/lib/sass/tree/visitors/base.rb:37:in `visit'
from /home/pwnall/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sass-3.2.8/lib/sass/tree/visitors/perform.rb:100:in `visit'
@pwnall
pwnall / rice-1.4.3-on-fedora18.log
Created Mar 16, 2013
The rice gem (1.4.3) fails to install on Fedora 18 due to extension compilation errors.
View rice-1.4.3-on-fedora18.log
/home/pwnall/.rbenv/versions/1.9.3-p194/bin/ruby extconf.rb
extconf.rb:20: Use RbConfig instead of obsolete and deprecated Config.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
@pwnall
pwnall / 00-mapnik_failed_1082.md
Last active Dec 14, 2015
mapnik failed to build on 10.8.2
View 00-mapnik_failed_1082.md

The output from HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install mapnik

  • stdout is in brew_install_stdout.log
  • stderr is in brew_install_stderr.log

The contents of ~/Library/Logs/Homebrew/mapnik/config.log is in library_logs_homebrew_mapnik_config.log

The output from brew doctor is in brew_doctor_output.log

@pwnall
pwnall / chrome_android_buid.md
Last active Dec 14, 2015
Step-by-step instructions for setting up a VM that builds Chrome for Android
View chrome_android_buid.md

Build Instructions for libchromewebview.so

This document contains step-by-step instructions for building a Chromium-powered Android WebView.

Chromium's build process is a bit fussy, and the Android target is even more fussy, so the least painful way of getting it done is to set up a VM with the exact software that the build process was designed for. The steps below accomplish this.

You can’t perform that action at this time.