Skip to content

Instantly share code, notes, and snippets.

@samtay
samtay / magento2-auto-login.js
Created February 14, 2017 23:46
Tamper Monkey script to automatically log into Magento2 admin panel
// ==UserScript==
// @name Local Login - M2
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author Sam Tay
// @match *.dev/*admin*
// ==/UserScript==
// Credentials
@samtay
samtay / magento1-auto-login.js
Created February 14, 2017 23:45
Tamper Monkey script to automatically log into Magento admin panel
// ==UserScript==
// @name Local Login
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author Sam Tay
// @match *.dev/*admin*
// ==/UserScript==
// Set your username and password here
@samtay
samtay / workfront-balance.js
Created February 14, 2017 23:43
Tamper Monkey script to show WorkFront budget
// ==UserScript==
//@name Attask Balance
//@version 0.1
//@description Auto calculate hours balance
//@author Sam Tay
//@match https://blueacorn.attask-ondemand.com/task/view*
//@grant none
// ==/UserScript==
jQuery(document).ready(function($) {
@samtay
samtay / expoImgsResize.sh
Created December 10, 2016 00:40
Resize images for Expo Trade Exhibit
cd ~/images-directory
mkdir resized
for f in *.png; do
convert $f -resize 800x600 -gravity center -background "rgba(0,0,0,0)" -extent 800x600 resized/$f
done
@samtay
samtay / skel.plugin.zsh
Last active November 4, 2016 16:40
Easy BA skel commands
### Put this file in ~/.oh-my-zsh/custom/plugins/skel/skel.plugin.zsh
### and add to ~/.zshrc -> plugins = (skel)
# compdef ba-skel
function _ba-skel() {
_detect_skel || return 1
_files -W "$(_get_repo_root)/skel/bin"
}
@samtay
samtay / magento2.plugin.zsh
Last active August 13, 2018 16:40
Auto completion & portability for bin/magento
# ------------------------------------------------------------------------------
# FILE: m2.plugin.zsh
# DESCRIPTION: oh-my-zsh m2 autocomplete file. Adapted from composer plugin
# AUTHOR: Sam Tay (sam.chong.tay@gmail.com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
# Keep this up to date by checking bin-magento list --raw --no-ansi
_bin_magento_get_command_list () {
bin-magento --raw --no-ansi list | sed "s/[[:space:]].*//g"