Skip to content

Instantly share code, notes, and snippets.

View zabawaba99's full-sized avatar

Steven Berlanga zabawaba99

View GitHub Profile
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationPreparedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.env.AbstractEnvironment;
import org.springframework.core.env.CompositePropertySource;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.support.ResourcePropertySource;
import org.springframework.stereotype.Component;
@zabawaba99
zabawaba99 / docker-up.sh
Created April 27, 2016 12:14
Docker up AWS EC2 Linux System
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Please provide the ec2 hostname to ssh into"
exit 1
fi
HOST=$1
if [ -z "$2" ]; then
echo "Please provide the pem key used to ssh into the ec2 instance"
test do
(testpath/"test-server.go").write <<-EOS.undent
package main
import (
"flag"
"fmt"
"log"
"net/http"
"regexp"
script:
- ./build.sh
- ./deploy.sh
ignore:
- .git
- .snag.yml
verbose: true
@zabawaba99
zabawaba99 / pool_bench_test.go
Created August 31, 2015 14:20
Benchmarking new go routine vs pool
package wrkpool
import (
"sync"
"testing"
)
const RunCount = 10000
func BenchmarkTestNewRoutine(b *testing.B) {
@zabawaba99
zabawaba99 / DatabaseInterface.java
Created August 31, 2015 12:42
sqlite database helpers for android
public class DatabaseInterface extends SQLiteOpenHelper implements NewsDatabaseInterface {
public NewsDatabaseInterface newsHelper;
// Database version
private static final int DATABASE_VERSION = 1;
public DatabaseInterface(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
newsHelper = new NewsDatabaseImpl(this);
}
@zabawaba99
zabawaba99 / update-godeps.sh
Created July 28, 2015 19:23
Auditing and Updating your Godeps
#!/bin/bash
function update-dep() {
echo "Auditing $1"
curdir=$(pwd)
cd $GOPATH/src/$1
git checkout master > /dev/null 2>&1
git pull > /dev/null 2>&1
cd $curdir
@zabawaba99
zabawaba99 / Glass Device Spec
Last active December 22, 2015 18:08
Goggle Glass Device Specs
The following specifications are for the first batch of Google Glass devices that have been shipped.
Display Metrics: density=1.5, width=640, height=36-, scaledDensity=1.5, xdpi=180.62222, ydpi=169.33333
Manufacturer Brand: Google
Screen Size in Inches: 4.132170655589192
FINGERPRINT= Google/glass_1/glass-1:4.0.4/XRS68/813833:user/release-keys
HARDWARE= omap4430
UNKNOWN= unknown
RADIO= unknown