Skip to content

Instantly share code, notes, and snippets.

View mchelen's full-sized avatar

Mike Chelen (he/him) mchelen

View GitHub Profile
@mchelen
mchelen / app.js
Created May 1, 2014 21:34
Recline.js Multiview Demo
jQuery(function($) {
window.dataExplorer = null;
window.explorerDiv = $('.data-explorer-here');
// This is some fancy stuff to allow configuring the multiview from
// parameters in the query string
//
// For more on state see the view documentation.
var state = recline.View.parseQueryString(decodeURIComponent(window.location.search));
if (state) {
@mchelen
mchelen / gist:7274e02252fe29c2c313
Created June 13, 2014 06:51
antennapod notification buttons
Intent playButtonIntent = new Intent(
PlaybackService.this, PlaybackService.class);
playButtonIntent.putExtra(
MediaButtonReceiver.EXTRA_KEYCODE,
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE);
PendingIntent playButtonPendingIntent = PendingIntent
.getService(PlaybackService.this, 0,
playButtonIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
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: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:
$ 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 / index.html
Last active August 29, 2015 14:08
jsonresume registry shim
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>TEST</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">