Skip to content

Instantly share code, notes, and snippets.

View johnjohndoe's full-sized avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@stefanhoth
stefanhoth / jack.bat
Last active August 29, 2015 14:11
Jack & Jill command line helpers. Put them in a directory in your PATH, e.g. <android-sdk>/. Use .bat files for Windows, .sh for Mac/Linux. More info in the documentation: http://tools.android.com/tech-docs/jackandjill
@ECHO OFF
@REM Jack is only available from build tools version 21.1.0 and up. Install/Update via SDK Manager
SET BUILD_TOOLS_VERSION=21.1.2
java -jar %ANDROID_HOME%/build-tools/%BUILD_TOOLS_VERSION%/jack.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
@falkorichter
falkorichter / AndroidManifest.xml
Last active August 29, 2015 14:17
custom name for debug buildType
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="${applicationLabel}">
<activity
android:label="${applicationLabel}">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
@falkorichter
falkorichter / androidJarTasks.gradle
Last active August 29, 2015 14:18
Add all kinds of Jar tasks to your project
def generateJavadocJar = project.task("generateJavadocJars"){
description "Generate all Javadoc Jars of all Variants"
group 'jar'
}
def generateJavadoc = project.task("generateJavadocs"){
description "Generate all Javadoc of all Variants"
group 'jar'
}
@ptrv
ptrv / ChangeGpxTrackName.rb
Created January 31, 2011 00:55
Change track names in GPX files (ruby)
#!/usr/bin/env ruby
# Script for assigning the date of a track in a GPX file as track name.
#
# Usage e.g $ ruby ChangeGpxTrackName.rb source.gpx target.gpx"
#
# Peter Vasil
# Date: 2011-01-31
@ptrv
ptrv / CreateVersionNumber.py
Last active September 24, 2015 23:38
generating version code from string
#!/usr/bin/python
# Script for generating a software version code(hex) from a version string.
#
# Usage e.g $ python CreateVersionNumber.py 1.4.2"
#
# Peter Vasil
# Date: 2011-02-15
from optparse import OptionParser
@ptrv
ptrv / gitignore-rules-adder.py
Last active September 25, 2015 04:57
Script for adding ignore rules to gitignore files.
#!/usr/bin/python
# Script for adding ignore rules to gitignore files.
#
# Peter Vasil
# Date: 2011-03-11
import sys
from optparse import OptionParser
@jcf
jcf / email_validator.rb
Created September 2, 2011 10:48 — forked from stauntonknight/email_validator.rb
Rails 3 Email Validator
require 'mail'
class EmailValidator < ActiveModel::EachValidator
attr_reader :record, :attribute, :value, :email, :tree
def validate_each(record, attribute, value)
@record, @attribute, @value = record, attribute, value
@email = Mail::Address.new(value)
@tree = email.__send__(:tree)
@sra448
sra448 / tail.py
Created November 9, 2011 16:44
sublime text 2 command for tailing and greping the rails logfile
import sublime, sublime_plugin, os
class TailCommand(sublime_plugin.TextCommand):
def run(self, edit):
from datetime import datetime
filtertext = "FLO"
# open sublime console
self.view.window().run_command("show_panel", { "panel": "console", "toggle": "true" })
@Abizern
Abizern / pre-commit
Created March 12, 2012 19:00
pre-commit
#!/usr/bin/env sh
# Tidy up whitespace on commit.
# By-pass it with the --no-verify option to git commit
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904