Skip to content

Instantly share code, notes, and snippets.

@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"
@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 / 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 / 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 / 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 / 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 / better_indeed.js
Created July 24, 2017 02:22
Better Indeed Results (filter sponsored)
// ==UserScript==
// @name Better Indeed
// @version 0.1
// @description Ignores sponsored links
// @author samtay
// @match http*://www.indeed.com/*
// @grant none
// ==/UserScript==
(function() {
@samtay
samtay / better_surfline.js
Last active October 14, 2020 05:02
Reveal more forecast data
// ==UserScript==
// @name Free Surfline Forecasts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Unblurr restricted forecast data. They are dumb enough to actually put the real data in the DOM.
// @author samtay
// @match http*://www.surfline.com/*
// @grant none
// ==/UserScript==
@samtay
samtay / stack-ghcid.zsh
Created April 18, 2019 17:51
Forward `stack ghci` completions to `ghcid -c 'stack ghci...'`
stack-ghcid()
{
ghcid -c 'stack ghci '"$@"''
}
_stack-ghcid()
{
local CMDLINE
local IFS=$'\n'
export COMP_LINE="${COMP_LINE/stack-ghcid/'stack ghci'}"
@samtay
samtay / homework.sty
Last active April 2, 2020 21:50
CSE 546 hw template
\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
%\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage[plain]{algorithm}
\usepackage{algpseudocode}
\usepackage{physics}