Skip to content

Instantly share code, notes, and snippets.

View paulvi's full-sized avatar

Paul Verest paulvi

View GitHub Profile
@ksc91u
ksc91u / gist:f167a7d56e0c2646c9c8
Last active February 19, 2018 10:21
aapt malformed 9 patch image
#!/bin/bash
enable pwd
args=("$@")
DIR="$(cd "$(dirname "$0")" && pwd)"
case "${args[@]}" in
*".9.png"*)
$DIR/aapt.17 $@
;;
@bennadel
bennadel / http-angularjs.htm
Created April 21, 2014 16:52
Using The $http Service In AngularJS To Make AJAX Requests
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Using The $http Service In AngularJS To Make AJAX Requests
</title>
<style type="text/css">
@semistrict
semistrict / gradlew
Last active December 26, 2015 23:19
gradlew search script
#!/bin/bash
_dir=$(pwd -P)
_lastdir=
until [ "$_dir" -ef "$_lastdir" ]; do
_cmd="$_dir/gradlew"
if test -e "$_cmd"; then
exec "$_cmd" "$@"
return $?
@tobsch
tobsch / SSCCE.java
Created July 9, 2013 07:58
Nashorn Threading Problem
import javax.script.CompiledScript;
import javax.script.Compilable;
import javax.script.ScriptException;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
import jdk.nashorn.api.scripting.NashornScriptEngine;
import java.util.concurrent.Future;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
@khernyo
khernyo / build.gradle
Created December 6, 2012 18:39
Gradle Android configuration with .so hack
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
@streunerlein
streunerlein / gist:3332181
Created August 12, 2012 14:58
NPM Mirrors & Proxies

Definition

Mirrors: standalone servers with complete copy of npm registry

Proxies: proxy to the database (couchdb) of npm registry, if only the npm registry server fails but the db works

## HowTo See this gist: https://gist.github.com/3331671

Mirrors

(+) means server is self updating (pulls newest stuff from offical registry when back online again)

# use the npm mirror:
npm set registry http://ec2-46-137-149-160.eu-west-1.compute.amazonaws.com
# you can reset this later with npm set registry npm set registry https://registry.npmjs.org/
# then use it normally:
npm install express
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@joelverhagen
joelverhagen / README.md
Created February 12, 2012 02:14
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@bnoordhuis
bnoordhuis / trace-all-events.js
Created January 3, 2012 14:38
Trace all events in a node.js application
(function() {
var EventEmitter = require('events').EventEmitter;
var inspect = require('util').inspect;
var emit_ = EventEmitter.prototype.emit;
EventEmitter.prototype.emit = function(name) {
var args = Array.prototype.slice.call(arguments);
if (!(this === process.stderr && name === 'drain')) {
console.error("Event '%s', arguments: %s",
name, inspect(args.slice(1), false, 1));
}