Skip to content

Instantly share code, notes, and snippets.

@azam
azam / applicationContext-dynamodb.xml
Created April 7, 2014 07:06
Sample Spring application context to autowired DynamoDB client, with region or endpoint settings from proeprties or environment variable
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
@azam
azam / archive-twitpic-data.py
Last active August 29, 2015 14:06 — forked from hugs/archive-twitpic-data.py
Twitpic Image and Data Archiver. Added exception handling, timeout, retry to page info and image file download
# Archive your Twitpic photos and metadata
#
# A cleaned-up fork of Terence Eden's original archiver:
# http://shkspr.mobi/blog/2013/08/exporting-twitpic-images-python/
#
# License: MIT
import shutil
import urllib2
import socket
@azam
azam / Dockerfile
Last active August 29, 2015 14:16
Dockerfile for Debian 7 (Wheezy) , Oracle JDK 7 , and default user creation
# (c) Azamshul Azizy, 2014
#
# Original files:
# https://github.com/dockerfile/java/tree/master/oracle-java7
# https://github.com/clifton/docker-debian-base/master/Dockerfile
# Pull base image.
FROM debian:7
MAINTAINER Azamshul Azizy <azamshul@gmail.com>
@azam
azam / Dockerfile
Last active August 29, 2015 14:16
FontCustom container on Debian 7
# (c) Azamshul Azizy, 2015
#
# Debian based container for fontcustom
# Ref: https://github.com/FontCustom/fontcustom/
# Ref: http://pivotallabs.com/generate-icon-fonts-automatically-with-fontcustom/
#
# TODO: install ttf2eot
#
# Usage example:
# docker run -v /home/me/svgs:/target -t azamshul/fontcustom compile /target --output /target/output
@azam
azam / ec2prepare.sh
Last active August 29, 2015 14:23
EC2 environment preparation script for Java/Maven
#!/bin/sh
sudo yum -y update
sudo wget https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum -y install java-1.8.0-openjdk-devel apache-maven git
sudo alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
@azam
azam / ec2jenkins.sh
Last active September 5, 2015 00:49
EC2 Jenkins preparation script
#!/bin/bash
# This script is intended to be run as preparation script
# during creation of ec2 instance, which is executed as root.
# So we don't need to run these commands with sudo over here.
wget https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
# NOTE: execute this 4 commands if you change repo, ie redhat to redhat-stable
# rm -f /var/lib/rpm/__db*
# rpm --rebuilddb
# yum clean all
@azam
azam / stack.js
Created November 10, 2015 09:30
Simple Javascript stack library
/**
* stack.js
* (c) 2015 Azamshul Azizy
*
* [description]
* @param {[type]} factory [description]
* @return {[type]} [description]
*/
(function(stackjs) {
// if (typeof(define) === "function" && typeof(define.amd) !== "undefined") {
@azam
azam / Preferences.sublime-settings
Created November 22, 2015 19:54
Azam's Sublime Text 3 User Settings
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
{
"draw_white_space": "all",
"rulers": [80],
"font_face": "Ricty Diminished", // https://github.com/yascentur/RictyDiminished
"font_size": 11,
"font_options": ["directwrite"],
"line_padding_top": 0,
"line_padding_bottom": 0,
@azam
azam / .profile
Last active January 29, 2016 03:18
Mac OSX Bash Profile
### Java
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
### Maven
export MAVEN_HOME="$HOME/Applications/apache-maven-3.3.3"
export M3=$MAVEN_HOME
export M3_HOME=$M3
export PATH=$PATH:$M3_HOME/bin
### Android
@azam
azam / mvn.sh
Created February 29, 2016 03:13
Add custom jar as local repo
mvn install:install-file -Dfile=my-library.jar -DgroupId=io.azam -DartifactId=my-library -Dversion=1.0.0 -Dpackaging=jar -DgeneratePom=true -DlocalRepositoryPath=./repo -Dsources=my-library-src.jar