This file contains 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
java.lang.NoSuchMethodError: No virtual method getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object; in class Lsun/misc/Unsafe; or its super classes (declaration of 'sun.misc.Unsafe' appears in /system/framework/core-libart.jar) | |
E at com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.gasWaiters(AbstractFuture.java:1394) | |
E at com.google.common.util.concurrent.AbstractFuture.releaseWaiters(AbstractFuture.java:1110) | |
E at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1000) | |
E at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:783) | |
E at com.google.auth.oauth2.OAuth2Credentials$RefreshTask.access$400(OAuth2Credentials.java:600) | |
E at com.google.auth.oauth2.OAuth2Credentials$RefreshTask$1.onSuccess(OAuth2Credentials.java:617) | |
E at com.google.auth.oauth2.OAuth2Credentials$RefreshTask$1.onSuccess(OAuth2Credentials.java:614) | |
E at com.google.common.util.concurrent.Fut |
This file contains 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
# Usage: ghurl <filepath> | |
# Opens the file in github corresponding to a local path. Respects repo name, branch name (defaults to master). | |
function ghurl() { | |
domain='http://github.com' && | |
repo=$(git config --get remote.origin.url | cut -d: -f2 | cut -d. -f1) && | |
# Fallback to master branch | |
remoteBranch=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo 'master') && | |
# Remove origin prefix | |
remoteBranch=${remoteBranch#origin/} && | |
currentDir=$PWD && |
This file contains 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
from collections import Counter | |
FILENAME = 'aspath.txt' | |
f = open(FILENAME, 'r') | |
for line in f: | |
# print 'Line read is ', line | |
mylist = line.split() | |
This file contains 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
- Start on single user mode: Hit the Command and S keys at start-up | |
Wait until the writing stops completely | |
-At the line, type (after root): /sbin/fsck -fy (space after the k) | |
Hit the ENTER key | |
wait until it finishes and says "... appears to be OK" | |
next, type: /sbin/mount -uw / (space after the t and after the w) |
This file contains 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
# Problem | |
$ open -a Android\ Studio | |
LSOpenURLsWithRole() failed for the application /opt/homebrew-cask/Caskroom/android-studio/0.6.1 build-135.1224218/Android Studio.app with error -10810. | |
# Fix | |
$ /usr/libexec/PlistBuddy -c 'Set :JVMOptions:JVMVersion 1.8*' //opt/homebrew-cask/Caskroom/android-studio/0.6.1\ build-135.1224218/Android\ Studio.app/Contents/Info.plist |
This file contains 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
#!/bin/sh | |
# Install Atom directly without invitation | |
# by @leaskh | |
cd ~ | |
curl -L https://www.atom.io/api/updates/download -A "Atom/0.1 CFNetwork/1.5" > Atom.zip | |
open Atom.zip | |
mv Atom.app /Applications/ | |
rm -rf Atom.zip |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am ashishb on github. | |
* I am ashishb (https://keybase.io/ashishb) on keybase. | |
* I have a public key whose fingerprint is DC5D 1E98 F335 E7B3 8E78 C25F 1BDE 4BB1 723D 0912 | |
To claim this, I am signing this object: |
This file contains 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
// A fault tolerant Google apps script for fetching dividend data from Yahoo Finance (original fault intolerant script was taken from http://seekingalpha.com/article/568641-using-google-spreadsheet-as-your-watch-list | |
function GetDividends(symbol) { | |
/* Manipulate the symbol, as necessary */ | |
if (symbol.search(/\.b/i) >= 0) | |
{ | |
symbol = symbol.replace(/\.b/i, "-B"); | |
} | |
This file contains 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
# Run this script using Monkeyrunner. | |
import commands | |
import time | |
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice | |
def click(device, x, y): | |
device.touch(x, y, MonkeyDevice.DOWN_AND_UP) | |
This file contains 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
import hashlib | |
even_count = 0 | |
odd_count = 0 | |
for x in xrange(0, 1000, 1): | |
if int(hashlib.sha256(str(x)).hexdigest(), 16)%2 == 0: | |
even_count += 1 | |
else: | |
odd_count += 1 |