Skip to content

Instantly share code, notes, and snippets.

View mchelen's full-sized avatar

Mike Chelen mchelen

View GitHub Profile
addPreferencesFromResource(R.xml.preferences);
if (android.os.Build.VERSION.SDK_INT < 16) {
PreferenceScreen screen = getPreferenceScreen();
Preference pref = getPreferenceManager().findPreference(PREF_EXPANDED_NOTIFICATION);
screen.removePreference(pref);
}
@mchelen
mchelen / gist:60b2853bf84117088662
Last active May 15, 2017 02:00
man zsh ubuntu 14.04
#!/bin/bash
# for ubuntu 14.04 with zsh 5.0.2
# bug: https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1242108
# file src: http://sourceforge.net/projects/zsh/files/zsh/5.0.2/zsh-5.0.2.tar.gz/download
wget -qO- "http://downloads.sourceforge.net/project/zsh/zsh/5.0.2/zsh-5.0.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fzsh%2Ffiles%2Fzsh%2F5.0.2%2F&ts=1407408881&use_mirror=superb-dca3" | sudo tar xvz -C /usr/share/man/man1/ --wildcards "zsh-5.0.2/Doc/*.1" --strip-components=2 && sudo chown root:root /usr/share/man/man1/zsh*.1
@mchelen
mchelen / gist:3f99300eb0b53f3e25a5
Last active August 29, 2015 14:06
Android Play Store Description Link Crash Demo
A bug in the Play Store causes it to crash when clicking links to other Play Store apps. This happens if the URL is linked in the app description. A normal URL is automatically linked without using HTML, but a URL to a Play Store app requires HTML. When using the HTML link in an app description, clicking it causes Play Store to crash.
Video demo: http://youtu.be/aXqhoshsaJ0
Tested Sep. 1 2014 on Android 4.4
**Warning: This link will crash Play Store:**
Play Store app link in HTML:
<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.maps">link</a>
Plain URL to a Play store app:
@mchelen
mchelen / gnuplot.gnu
Last active August 12, 2017 01:23 — forked from Noktec/gnuplot.gnu
#Use the testping.sh script to retrieve the times of a Pings
#Then use the following script to plot it with gnuplot
set terminal pdfcairo font "Gill Sans,9" linewidth 2 rounded fontscale 1.0
set output "ping.pdf"
set ylabel "Time in milliseconds"
set xlabel "Number of Pings"
plot "pingTimes.dat" w lp
$ rvm install ruby-2.1.3 --binary
Searching for binary rubies, this might take some time.
Requested binary installation but no rubies are available to download, consider skipping --binary flag.
$ rvm list remote
# Remote rubies available:
jruby-0.9.0
jruby-1.6.6
jruby-1.6.7
jruby-1.6.7.2
jruby-1.6.8
jruby-1.7.0
Started GET "/view/10.1371/journal.pone.0081648" for 10.0.2.2 at 2014-10-19 13:25:28 +0000
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by PapersController#view as HTML
Parameters: {"id"=>"10.1371/journal.pone.0081648"}
Rendered papers/_transform.html.ruby (19.0ms)
Rendered papers/view.html.erb within layouts/viewer (46.1ms)
Completed 200 OK in 484ms (Views: 450.8ms | ActiveRecord: 0.0ms)
@mchelen
mchelen / gist:d2f07c735af52beb3320
Created October 20, 2014 23:40
monitor pid 1916
#!/bin/bash
while :
do
ps uh -p 1916 2>&1 | tee -a memlog
sleep 1
done
@mchelen
mchelen / index.html
Last active August 29, 2015 14:08
rich citations cytoscape.js
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/cytoscape.min.js"></script>
<script src="script.js"></script>
<style>
#cy {
height: 100%;
@mchelen
mchelen / .gitignore
Last active October 10, 2017 19:10
json resume test
*~