Skip to content

Instantly share code, notes, and snippets.

azam / settings.json
Created Jan 16, 2017
Visual Studio Code User Settings
View settings.json
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "all",
"editor.fontFamily": "Ricty Diminished",
"editor.fontSize": 12,
"editor.lineHeight": 12,
"window.zoomLevel": 0
azam / Dockerfile
Last active Jan 12, 2017
Dockerfile for create-react-app, since I don't want to polute my node global modules. Creates a temporary project on build and removes it afterward, to cache the latest packages on build-time. Build: `docker build -t azam/create-react-app`. Usage: `docker run --rm -v $PWD:/project azam/create-react-app my-project-name`
View Dockerfile
FROM node:6-alpine
RUN npm install -g create-react-app \
&& mkdir /project \
&& cd /project \
&& /usr/local/bin/create-react-app tmp-project \
&& rm -rf ./tmp-project
WORKDIR /project
ENTRYPOINT ["/usr/local/bin/create-react-app"]
azam / .profile
Last active Jan 5, 2017
Common bash profile for macOS
View .profile
### prep a dir for git with github sane defaults
### usage: gitprep ulidj azam/ulidj
gitprep() {
if [ -z "$2" ]
echo "gitprep: illegal arguments"
echo "usage: gitprep [dirname] [reponame]"
return -1
mkdir $1
azam / Dockerfile
Created Nov 18, 2016
DynamoDB Local with Java8 on Alpine. Example: docker run -p 18000:8000 -v /Users/me/ddb/data:/dynamodb/data azamshul/dynamodb-local:latest
View Dockerfile
FROM anapsix/alpine-java:8
RUN apk --no-cache add --update curl \
&& mkdir /dynamodb \
&& mkdir /dynamodb/bin \
&& cd /dynamodb/bin \
&& /usr/bin/curl -L | /bin/tar xz \
&& apk del curl
WORKDIR /dynamodb/data
ENTRYPOINT ["java", "-Djava.library.path=/dynamodb/bin/DynamoDBLocal_lib", "-jar", "/dynamodb/bin/DynamoDBLocal.jar", "-port", "8000", "-dbPath", "/dynamodb/data"]
azam / gist4sites.xml
Last active Feb 7, 2020
Gadget to embed gist on Google Site. Use this url as gadget URL when inserting to a Google Site page:
View gist4sites.xml
<?xml version="1.0" encoding="UTF-8" ?>
<ModulePrefs title="Google Sites Gist Module">
<Require feature="dynamic-height"/>
<UserPref name="gistId" display_name="Gist #" required="true" />
<UserPref name="baseUrl" display_name="Base URL" required="false" default_value=""/>
<Content type="html">
<div id="content_div"><script src="__UP_baseUrl__/__UP_gistId__.js"></script><script type="text/javascript">gadgets.util.registerOnLoadHandler(gadgets.window.adjustHeight);</script></div>
azam /
Created Feb 29, 2016
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
azam / .profile
Last active Jan 29, 2016
Mac OSX Bash Profile
View .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 / Preferences.sublime-settings
Created Nov 22, 2015
Azam's Sublime Text 3 User Settings
View Preferences.sublime-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", //
"font_size": 11,
"font_options": ["directwrite"],
"line_padding_top": 0,
"line_padding_bottom": 0,
azam / stack.js
Created Nov 10, 2015
Simple Javascript stack library
View stack.js
* 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 /
Last active Sep 5, 2015
EC2 Jenkins preparation script
# 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 -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