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 picasa_download.rb
# Backs up all the photos from Google Picasa Web Albums.
# The script downloads the original version of the photos, and is not limited to
# 1600x1200 thumbnails.
# Author:: Victor Costan
# Copyright:: Copyright (C) 2010 Victor Costan
# License:: MIT
require 'yaml'
View cpu_count.rb
# Prints the number of cores on your system.
# Requires the ohai rubygem.
require 'rubygems'
require 'ohai'
ohai =
View facebook_token.rb
# Wraps an OAuth2 access token for Facebook.
class FacebookToken < ActiveRecord::Base
# The user whose token this is.
belongs_to :user
validates :user, :presence => true
# A unique ID on the Facebook site for the user owning this token.
validates :external_uid, :length => 1..32, :presence => true
# The OAuth2 access token.
pwnall / gist:2519877
Created Apr 28, 2012
Multiple HTTP requests in a single Rails controller action
View gist:2519877

Whenever users sign into my application, or access its homepage, I check to see if I have recent Facebook data for them. If not, I synchronously fetch the data from Facebook. I'd do it asynchronously, but I don't want to add logic for rendering the homepage with incomplete information.

The controller code is the if statement that starts here:

Facebook data is cached in the Profile model (each user has a profile), and in the UserFriendship model.

The model code that does the fetches is here:

The code calls some code in the fbgraph gem to fetch profile information. It also calls the method below, which uses curl to follow redirects:

pwnall /
Created Jun 29, 2012
Builder for encap packages for Ruby, the Sass compiler, Node.js and the CoffeeScript compiler
#### node-coffeescript-1.3.3 encap package
## Requires: nodejs-0.8.0
## Set up the encap cage.
# NOTE: this dance ensures that the build process is properly contained
sudo mkdir /usr/local/encap/node-coffeescript-1.3.3
sudo chown $USER:$USER /usr/local/encap/node-coffeescript-1.3.3
## Build and install in the encap cage.
pwnall / config.log
Created Aug 11, 2012
config.log after attempting to install Inkscape
View config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by inkscape configure, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-dependency-tracking --enable-lcms --disable-poppler-cairo --prefix=/usr/local/Cellar/inkscape/
## --------- ##
## Platform. ##
pwnall / Gemfile
Created Oct 18, 2012
Grader sample code
View Gemfile
source :rubygems
gem 'sinatra', '>= 1.3.1', require: 'sinatra/base'
gem 'shotgun', '>= 0.9'
gem 'thin', '>= 1.3.1'
pwnall /
Created Dec 1, 2012 — forked from mikefaille/Fed_install_3.7_rc6_krnl
Fedora install kernel 3.7 rc7 x64
sudo yum install --nogpg
pwnall /
Last active Dec 14, 2015
Step-by-step instructions for setting up a VM that builds Chrome for Android

Build Instructions for

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.

pwnall /
Last active Dec 14, 2015
mapnik failed to build on 10.8.2

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

You can’t perform that action at this time.