Skip to content

Instantly share code, notes, and snippets.

View Manishearth's full-sized avatar
🍃
yahaha! you found me!

Manish Goregaokar Manishearth

🍃
yahaha! you found me!
View GitHub Profile
@Manishearth
Manishearth / kalina.py
Created January 31, 2014 16:25
Kalina emulator
#!/usr/bin/python
# kalina.py
# by Manish Goregaokar
# requires https://github.com/Manishearth/ChatExchange
from random import choice
import json,os,sys
from ChatExchange.SEChatWrapper import *
if("ChatExchangeU" in os.environ):
username=os.environ["ChatExchangeU"]
@Manishearth
Manishearth / mainsite.user.js
Last active August 29, 2015 13:56
Main site links on SE Meta topbar
// ==UserScript==
// @name Main site link on meta topbar
// @namespace Manishearth
// @description Brings back the bold reputation counter/post scores!
// @include http://meta.stackoverflow.com/*
// @include http://meta.serverfault.com/*
// @include http://meta.superuser.com/*
// @include http://stackapps.com/*
// @include http://meta.*.stackexchange.com/*
// @include http://meta.askubuntu.com/*
enum SyncOrAsync<'a> {
Sync(&'a mut JSRef<'a, XMLHttpRequest>),
Async(TrustedXHRAddress)
}
...
impl XMLHttpRequest {
...
fn progress_syncorasync(sync: SyncOrAsync, msg: XHRProgress, script_chan: &ScriptChan) {
match sync {
### Keybase proof
I hereby claim:
* I am Manishearth on github.
* I am manishearth (https://keybase.io/manishearth) on keybase.
* I have a public key whose fingerprint is A5FD F4DA 0438 0CF5 F7B6 1E9B F6DA 825A FA38 FADC
To claim this, I am signing this object:
@Manishearth
Manishearth / snapshot.sh
Created June 24, 2014 11:12
Creating a new snapshot
cd rust
git checkout master
git pull rust-lang master
git branch -D travis
git checkout -b travis
git cherry-pick $(git rev-parse ci)
git push -f mozilla-servo travis

####Clone the repositories:

git clone git://git.yoctoproject.org/poky
cd poky
git clone git://git.yoctoproject.org/meta-raspberrypi
git clone git://git.openembedded.org/meta-openembedded
git clone git://github.com/imphil/meta-b2g.git
. ./oe-init-build-env rpi-build
pub trait Show {
#[scheme(
TupleLike(try!(fmt.write_str(concat!($_name, "("))); try!($_); fmt.write(b")")),
AnonymousList(try!($_);try!(fmt.write_str(","))),
NamedList(try!(fmt.write_str(concat!($_name,":")));try!($_);try!(fmt.write_str(","))),
StructLike(try!(fmt.write_str(concat!($_name, "{"))); try!($_); fmt.write(b"}")),
UnitLike(fmt.write_str($_name))
)]
fn fmt(&self, fmt: &mut Formatter) -> Result;
}
@Manishearth
Manishearth / html
Created November 30, 2014 09:44
Locally load HTML spec
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains html.spec.whatwg.org \
--no-parent \
https://html.spec.whatwg.org/multipage
@Manishearth
Manishearth / gist:f2971973e164be03890a
Last active August 29, 2015 14:14
Smarter build system

Here's a design for a smarter build system that I've been toying with. It tweaks the current build system so that it is possible to solve the problem of PRs piling up by getting more build machines -- this isn't possible right now since PRs need to be tested sequentially for a 100% guarantee that they won't break anything.

It introduces three priority levels:

  • p=rollup: Treat as usual. Rollup into a big ball every few days.

  • p != rollup:

    • Lets say we have X extra build machines. Take X such PRs. First see if they can all be merged without conflicts, else choose a different set of X PRs
    • Test these PRs in parallel on the extra build machines, applied on top of master. This can be done whilst another build is running, provided these PRs apply cleanly on top of both master and the current build. (If not, pick a different set of PRs)
  • A slightly improved way of doing this is instead of testing A,B,C,D on tryservers, we test A, A+B, A+B+C, A+B+C+D. This makes it easier to identify which PRs are con

@Manishearth
Manishearth / fetch.sh
Created February 6, 2015 17:49
Deps for Servo on the Flame
# The function name lies
shallowclone() {
mkdir $2
cd $2
git init
git remote add origin $1
# Unfortunately, `git fetch origin $SHA --depth n` isn't working
# perhaps git.mozilla.org doesn't support such fetches?
git fetch origin
git checkout $3