Skip to content

Instantly share code, notes, and snippets.

@janardhannallapati
janardhannallapati / copy hyperlinked text
Created March 5, 2015 18:17
To easily coopy paste the lecture names from coursera lextures e.g:https://class.coursera.org/mobilecloud-001/lecture
$('a[title="Video (MP4)"]').hide();
$('a[title="Subtitles (srt)"]').hide();
$('a[title="Subtitles (text)"]').hide();
$('a[class="lecture-link"]').contents().unwrap();
       public void run() {            android.os.Debug.startMethodTracing("lsd");            // ... method body elided            android.os.Debug.stopMethodTracing();        }
@janardhannallapati
janardhannallapati / new_gist_file.java
Created September 30, 2014 12:49
Often you will want to have a Dialog display on top of the current input method, because there is no reason for it to accept text. You can do this by setting the WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM window flag (assuming your Dialog takes input focus, as it the default) with the following code: From http://developer.android.com/refer…
 getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
         WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }

Put test1.js and test2.js into a tests/ directory, then run the suite:

$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js                                 
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js                         
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
USAGE: /usr/local/bin/gjslint [flags]
flags:
closure_linter.checker:
--closurized_namespaces: Namespace prefixes, used for testing
ofgoog.provide/require
(default: '')
(a comma separated list)

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})