Skip to content

Instantly share code, notes, and snippets.

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@chilicat
chilicat / disable-findbugs.gradle
Last active January 18, 2018 20:20
Gradle Findbugs: This gradle script will disable findbugs until "findbugs" task is in the task graph. This allows to skip the findbugs verification for cases it is not needed.
allprojects {
// Marker Task to enable findbugs.
task findbugs(
group: "Verification",
description: """Marker task to enabled findbugs. Findbugs is by default
disabled. E.g. ( ./gradlew findbugs build )"""
)
}
subprojects {
@jasonofearth
jasonofearth / gist:5923351
Created July 3, 2013 22:18
Android string array of US states
<string-array name="states">
<item>Alabama</item>
<item>Alaska</item>
<item>American Samoa</item>
<item>Arizona</item>
<item>Arkansas</item>
<item>California</item>
<item>Colorado</item>
<item>Connecticut</item>
<item>Delaware</item>
@srgtuszy
srgtuszy / gist:6371749
Last active May 18, 2022 03:16
Gradle task for uploading builds to TestFlight using HTTPBuilder
task uploadTf(dependsOn: assembleRelease) << {
def teamToken = '<TestFlight team token here>'
def apiToken = '<TestFlight api token here>'
def lists = '<TestFlight distribution lists here>'
def apk = file("build/apk/$project.name-release.apk")
def notes = new File(file('changelog.mdown')).getText("UTF-8")
def http = new HTTPBuilder('http://testflightapp.com')
println('Uploading build to TestFlight...')
http.request(POST, JSON) { req ->
uri.path = '/api/builds.json'
@derekbrameyer
derekbrameyer / gist:6891069
Last active December 25, 2015 00:49
Android .gitignore
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@cyrilmottier
cyrilmottier / CityBikesContract.java
Last active January 12, 2024 18:04
Using the new Gradle-based Android build system: a second example
package com.cyrilmottier.android.citybikes.provider;
import android.net.Uri;
import com.cyrilmottier.android.avelov.BuildConfig;
/**
* @author Cyril Mottier
*/
public class CityBikesContract {
@pozorvlak
pozorvlak / git-anonymize
Last active June 24, 2024 13:40
Anonymise Git history
#!/bin/sh
# Suppose you want to do blind reviewing of code (eg for job interview
# purposes). Unfortunately, the candidates' names and email addresses are
# stored on every commit! You probably want to assess each candidate's version
# control practices, so just `rm -rf .git` throws away too much information.
# Here's what you can do instead.
# Rewrite all commits to hide the author's name and email
for branch in `ls .git/refs/heads`; do
require 'optparse'
require 'pivotal-tracker'
TOKEN = 'YOUR_PIVOTAL_TOKEN'
PROJECT_IDS = [YOUR_PIVOTAL_PROJECT_ID]
TESTER_NAME = 'YOUR DEFAULT TESTER NAME (IF ANY)'
PivotalTracker::Client.token = TOKEN
def generate_options
options = {
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@derekbrameyer
derekbrameyer / CircularProgressView.java
Created May 7, 2014 18:57
CircularProgressView.java
package com.doomonafireball.samples.android.widget;
import com.doomonafireball.samples.android.R;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;