Skip to content

Instantly share code, notes, and snippets.

Avatar

Manu Sridharan msridhar

View GitHub Profile
@msridhar
msridhar / TestPasses.java
Created May 17, 2018
Dummy Error Prone check that does extra AST traversals
View TestPasses.java
package testpasses;
import com.google.auto.service.AutoService;
import com.google.errorprone.BugPattern;
import com.google.errorprone.ErrorProneFlags;
import com.google.errorprone.VisitorState;
import com.google.errorprone.bugpatterns.BugChecker;
import com.google.errorprone.matchers.Description;
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.util.TreeScanner;
@msridhar
msridhar / nullaway-build.gradle
Last active May 31, 2021
self-contained build.gradle for using NullAway on an Android app
View nullaway-build.gradle
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
// for android gradle plugin 3
google()
}
dependencies {
View gist:1359a2b1463d7ded35b16e4d7cd637c1
> mkdir ~/Documents/brew-20160402
> sudo mv /usr/local ~/Documents/brew-20160402
Password:
> /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
@msridhar
msridhar / gist:cb47fb3b3672692dc65190d59e8437ad
Created Apr 2, 2016
output of brew config and brew doctor
View gist:cb47fb3b3672692dc65190d59e8437ad
> brew config
HOMEBREW_VERSION: 0.9.8
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: ef70efa204c929b01ba0e7a4da843c70ed455313
Last commit: 63 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d149df8cb2ccea42c6bc5bcbfdcd3c688ccdf79c
Core tap last commit: 64 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
@msridhar
msridhar / profile.txt
Created Nov 23, 2013
Profile info for esnstrument.js on pdf.js
View profile.txt
Statistical profiling result from v8.log, (34593 ticks, 737 unaccounted, 0 excluded).
[Unknown]:
ticks total nonlib name
737 2.1%
[Shared libraries]:
ticks total nonlib name
19116 55.3% 0.0% /opt/local/bin/node
908 2.6% 0.0% /usr/lib/system/libsystem_c.dylib
@msridhar
msridhar / cpth.sh
Created Aug 24, 2013
Aliases for a command cpth that, given a relative path to a file, gets the absolute path and copies it to the Mac clipboard
View cpth.sh
alias realpath="python -c \"import os,sys; print os.path.realpath(sys.argv[1])\""
alias mypbcopy="tr -d '\n' | pbcopy"
function cpth {
realpath $1 | mypbcopy
}
View ObjectSens.java
class A {
A f;
void m() {
this.f = this;
}
}
main() {
A x = new A(); // a1
A y = new A(); // a2
boolean p = ???;
View CallStrings.java
class A {
Object id(Object x) {
return x;
}
}
main() {
A a = new A(); // a1
Object x = new Object(); // o1
Object y = new Object(); // o2
Object z = a.id(x); // z -> o1
@msridhar
msridhar / mergetex.pl
Created Mar 23, 2012
perl script for merging .tex files and BibTeX output into single .tex file
View mergetex.pl
#!/usr/bin/perl
# mergetex.pl
#
# Script for merging tex files into a single monolithic file. This
# script should make it easy to generate an ArXiV-friendly single
# .tex file from a paper that is broken into subfiles using LaTeX's
# \input{} command.
#
# USAGE:
@msridhar
msridhar / imdb_season_ratings.js
Created Feb 25, 2012
Compute Average IMDB Rating for TV Show Season using node.js
View imdb_season_ratings.js
var jsdom = require('jsdom');
var re = /(\d+)\.(\d+)/;
jsdom.env({
// IMDB show URL + '/eprate' (Simpsons URL below)
html: 'http://www.imdb.com/title/tt0096697/eprate',
scripts: ['http://code.jquery.com/jquery-1.7.1.min.js'],
done: function (errors, window) {
var $ = window.$;