Skip to content

Instantly share code, notes, and snippets.

<activity
android:name=".DangerousActivity"
android:label="@string/app_name"
android:permission="course.labs.permissions.DANGEROUS_ACTIVITY_PERM" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
@rondinif
rondinif / gist:9058989
Created February 17, 2014 20:59
Debugging Mobile Chrome using Desktop Chrome via ADB port forwarding.
adb forward tcp:9222 localabstract:chrome_devtools_remote
/***
Copyright (c) 2014 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
@lucaspiller
lucaspiller / Gemfile
Last active April 22, 2016 02:03
photos2tidy.rb - scripts to free your photos from Photos.app
source "httpso://rubygems.org"
gem 'sqlite3'
gem 'exiftool'
@ryanj
ryanj / .openshift\action_hooks\pre_build_nodejs
Last active May 24, 2016 13:57
Include support for packaging globally installable npm modules, or other executables, locally within a project's source (node_modules/.bin/)
#!/bin/bash
# Projects which rely on npm modules which are normally installed using "npm install -g"
# can make those dependencies available on OpenShift by including this file in their project source.
# Add this content to your project as ".openshift/action_hooks/pre_build_nodejs"
# Then, save your npm dependencies locally (without the '-g' flag):
# > npm install module_name --save
# Finally, add and commit your changes:
@dviramontes
dviramontes / cors.js
Created June 19, 2013 22:13
cors.js Nicholas Zakas' helper method to help sort out the browser differences in CORS or Cross Origin Resource Sharing support.
function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// Check if the XMLHttpRequest object has a "withCredentials" property.
// "withCredentials" only exists on XMLHTTPRequest2 objects.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
@dviramontes
dviramontes / jsonParser.js
Last active June 15, 2016 03:40
Ext.decode vs JSON.parse
// 48 instances of Ext.decode
// 23 instances of Ext.encode
// collection size 7
(function() {
console.time('test')
var x = Ext.decode(temp1.responseText);
console.timeEnd('test')
console.log(x)
})()//test: 0.597ms
#!/usr/bin/env bash
name=ronda
ruby -e "(-12..42).each { |i| print \"#{i}:\"; o=''; ARGV[0].each_byte { |x| o+=(x.ord-i).chr }; p o}" $name | grep 32 | sed "s/.*:\"\(.*\).$/\1/"
@mr-niels-christensen
mr-niels-christensen / index.html
Last active October 29, 2016 09:44
Semantic Web Recipes: Add a description using jquery and dbpedia lookup
<html lang="en">
<body>
<div class="item">
<b>Insert title here</b>
<div>Insert description here</div>
</div>
<div class="item">
<b>Insert title here</b>
<div>Insert description here</div>
</div>
@MarZab
MarZab / Gruntfile.js
Last active May 20, 2017 18:23
comments for npm package.json with a grunt.js task
/*jslint node: true */
'use strict';
module.exports = function (grunt) {
/*
1. make package.json.js and export the json that will be saved as package.json
2. run grunt package.json, the new file will be written and you get a patch as well
*/
grunt.registerTask('package.json', function () {