Skip to content

Instantly share code, notes, and snippets.

@ijin
ijin / eb_deploy_and_notify.sh
Last active September 29, 2023 16:41
Deploy to Elastic Beanstalk and notify via Slack
#!/bin/bash
set -x
export SHA1=`echo ${CIRCLE_SHA1} | cut -c1-7`
export ENV=`echo $1 | rev | cut -d \- -f1 | rev`
function dd_mute() {
if [[ ${DD_MUTE_ID+x} ]]; then
echo "muting DD monitor id: ${DD_MUTE_ID}"
curl -X POST "https://app.datadoghq.com/api/v1/monitor/${DD_MUTE_ID}/mute?api_key=${DD_API_KEY}&application_key=${DD_APP_KEY}"
@bbergler
bbergler / okhttp-okio-andorid-L
Last active August 29, 2015 14:03
workaround for android L preview okio packaging issue
apply plugin: 'android-library'
buildscript {
repositories {
mavenCentral()
}
}
configurations {
@steveliles
steveliles / Foreground.java
Created April 20, 2014 15:30
Class for detecting and eventing the foreground/background state of an Android app - API-level 14+
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
@cholick
cholick / build.gradle
Last active October 24, 2018 21:08
Using Gradle & jarjar to repackage and embed incompatible transitive dependencies
apply plugin: 'groovy'
repositories {
mavenCentral()
}
configurations {
patch
[compile, testCompile]*.exclude module: 'jersey-server'
}
@swankjesse
swankjesse / RetrofitCachingExample.java
Created June 29, 2013 03:03
Demonstrate HTTP caching with OkHttp and Retrofit.
/*
* Copyright (C) 2013 Square, Inc.
*
* 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
@willurd
willurd / web-servers.md
Last active April 20, 2025 00:42
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jkotchoff
jkotchoff / google_play_verification.rb
Last active July 6, 2023 17:57
Verifying an Android subscription in a Ruby on Rails app using the Google Play API
class GooglePlayVerification
require 'google/api_client'
# Refer:
# https://code.google.com/p/google-api-ruby-client/issues/detail?id=72
# and
# http://jonathanotto.com/blog/google_oauth2_api_quick_tutorial.html
# and
# http://milancermak.wordpress.com/2012/08/24/server-side-verification-of-google-play-subsc/
GOOGLE_KEY = 'xxx-xxx.apps.googleusercontent.com'
@fredgrott
fredgrott / eclipse_checkstyle560_android.xml
Created December 3, 2012 19:58
eclipse checkstyle 5.6.0 forandroid
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: Android Checks (Eclipse)
Description:
Slightly modified version of Sun Checks that better matches the default code formatter setting of Eclipse.
@kylekeesling
kylekeesling / Old TableSorter Indicators
Created November 24, 2011 19:50
Incorporate Bootstrap Styling into Sortable Table Helper
Link to older version of the asset on github:
https://github.com/twitter/bootstrap/raw/96c3e709963516a06ad6e723a7bba3fbf5fc1ba2/assets/img/tablesorter-indicators.png
@matthawley
matthawley / RoboGuice-2b2-Proguard
Created October 31, 2011 16:33
Latest RoboGuice Proguard File
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-ignorewarnings
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable,*Annotation*,Signature