Skip to content

Instantly share code, notes, and snippets.

Avatar

Franco Rondini rondinif

View GitHub Profile
View gist:8831568
<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 Feb 17, 2014
Debugging Mobile Chrome using Desktop Chrome via ADB port forwarding.
View gist:9058989
adb forward tcp:9222 localabstract:chrome_devtools_remote
View DemoDocumentProvider
/***
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 Apr 22, 2016
photos2tidy.rb - scripts to free your photos from Photos.app
View Gemfile
source "httpso://rubygems.org"
gem 'sqlite3'
gem 'exiftool'
@ryanj
ryanj / .openshift\action_hooks\pre_build_nodejs
Last active May 24, 2016
Include support for packaging globally installable npm modules, or other executables, locally within a project's source (node_modules/.bin/)
View .openshift\action_hooks\pre_build_nodejs
#!/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 Jun 19, 2013
cors.js Nicholas Zakas' helper method to help sort out the browser differences in CORS or Cross Origin Resource Sharing support.
View cors.js
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 Jun 15, 2016
Ext.decode vs JSON.parse
View jsonParser.js
// 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
View ucase-ronda.sh
#!/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 Oct 29, 2016
Semantic Web Recipes: Add a description using jquery and dbpedia lookup
View index.html
<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
comments for npm package.json with a grunt.js task
View Gruntfile.js
/*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 () {
You can’t perform that action at this time.