Skip to content

Instantly share code, notes, and snippets.

View YarGnawh's full-sized avatar

Ray Hwang YarGnawh

View GitHub Profile
@YarGnawh
YarGnawh / get_changeset_diff.sh
Last active August 6, 2025 14:23
Azure DevOps TFVC Changeset Diff Generator
#!/bin/bash
# Azure DevOps TFVC Changeset Diff Generator
#
# A bash script that generates unified diff patches from Azure DevOps TFVC (Team Foundation Version Control) changesets. This tool solves the common problem of extracting readable diffs from TFVC changesets, which Azure DevOps doesn't provide natively through # its API.
#
# Features
#
# - Fetches all files modified in a specific TFVC changeset
# - Retrieves both current and previous versions of each file
@YarGnawh
YarGnawh / poke.sh
Created March 29, 2025 15:50
why touch when you can poke
#!/bin/bash
# poke - enhanced touch command that creates directories if needed
# Usage: poke file_path
# Installation: Create `poke` file in `/usr/local/bin` and `chmod +x`
if [ $# -eq 0 ]; then
echo "Usage: poke <file_path>"
exit 1
fi
@YarGnawh
YarGnawh / lamp.sh
Last active June 15, 2018 17:22
Initialization script for CodeAnywhere container
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install language-pack-en-base
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install python-software-properties
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install bzip2 build-essential apt-transport-https
# Install node
<!DOCTYPE html>
<html>
<head>
<title>Puppet</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TimelineMax.min.js"></script>
<style>
.window {
position: relative;
@YarGnawh
YarGnawh / upgrade.sh
Created August 10, 2017 17:40
Upgrade PHP 5.6 to PHP 7.0 on Ubuntu Apache
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-mcrypt php7.0-mysql php7.0-mbstring php7.0-gd php7.0-curl php7.0-mcrypt
sudo a2dismod php5
sudo a2enmod php7.0
sudo service apache2 restart
@YarGnawh
YarGnawh / eq.js
Last active February 17, 2017 05:06
Equation Solver using Map/Reduce
function parse(eq) {
var nest = 0;
eq = eq.reduce(function(acc, val) {
if (val == '(') {
nest++;
} else if (val == ')') {
nest--;
}
if (val == '(' && nest == 1) {
@YarGnawh
YarGnawh / sorts.js
Created October 20, 2016 16:44
Sorts in Javascript
// Helper function to clone array
function cloneArray(arr) {
return arr.slice();
}
// Helper function to generate random number array
function randomArray(min, max, len) {
// Set default values
min = min || 0;

Programming Setup Tutorial

JavaScript (node.js for mac and windows)

Setup

@YarGnawh
YarGnawh / sample.html
Created August 25, 2016 07:47
Sample page of overlay scrolling with "locked" body
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.noscroll {
overflow: hidden;
}
@YarGnawh
YarGnawh / script.sh
Last active February 19, 2016 16:51
Setup LAMP & Wordpress for AWS EC2 Ubuntu 14.04
# Always run this line first
sudo apt-get update
# Almost always install a web server
sudo apt-get install -y apache2
# Install PHP + Apache PHP Module
sudo apt-get install -y php5 libapache2-mod-php5 php5-mcrypt
sudo apt-get install -y php5-gd libssh2-php