Skip to content

Instantly share code, notes, and snippets.

@azam
azam / Print-RecentFiles.ps1
Created September 7, 2023 21:25
Powershell function to print recent files recursively, defaults to last 1 day
function Print-RecentFiles {
Param (
[Parameter()][string]$Path,
[Parameter()][switch]$NoRecurse,
[Parameter()][int]$Days = 1,
[Parameter()][int]$Hours = 0,
[Parameter()][int]$Minutes = 0,
[Parameter()][int]$Seconds = 0
)
@azam
azam / settings.json
Created January 16, 2017 06:44
Visual Studio Code User Settings
{
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "all",
"editor.fontFamily": "Ricty Diminished",
"editor.fontSize": 12,
"editor.lineHeight": 12,
"window.zoomLevel": 0
}
@azam
azam / Dockerfile
Last active January 12, 2017 04:05
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`
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
azam / .profile
Last active January 5, 2017 03:12
Common bash profile for macOS
### prep a dir for git with github sane defaults
### usage: gitprep ulidj azam/ulidj
gitprep() {
if [ -z "$2" ]
then
echo "gitprep: illegal arguments"
echo "usage: gitprep [dirname] [reponame]"
return -1
else
mkdir $1
@azam
azam / Dockerfile
Created November 18, 2016 06:55
DynamoDB Local with Java8 on Alpine. Example: docker run -p 18000:8000 -v /Users/me/ddb/data:/dynamodb/data azamshul/dynamodb-local:latest
FROM anapsix/alpine-java:8
RUN apk --no-cache add --update curl \
&& mkdir /dynamodb \
&& mkdir /dynamodb/bin \
&& cd /dynamodb/bin \
&& /usr/bin/curl -L http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest | /bin/tar xz \
&& apk del curl
EXPOSE 8000
WORKDIR /dynamodb/data
ENTRYPOINT ["java", "-Djava.library.path=/dynamodb/bin/DynamoDBLocal_lib", "-jar", "/dynamodb/bin/DynamoDBLocal.jar", "-port", "8000", "-dbPath", "/dynamodb/data"]
@azam
azam / gist4sites.xml
Last active February 7, 2020 00:41
Gadget to embed gist on Google Site. Use this url as gadget URL when inserting to a Google Site page: https://cdn.rawgit.com/azam/2e35a393ee2425f40c6d04de4ce5926b/raw/5389dc5ce442eca1c517cfe12132a0b90553e965/gist4sites.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Google Sites Gist Module">
<Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="gistId" display_name="Gist #" required="true" />
<UserPref name="baseUrl" display_name="Base URL" required="false" default_value="https://gist.github.com"/>
<Content type="html">
<![CDATA[
<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
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
@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 / 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 / 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") {