Skip to content

Instantly share code, notes, and snippets.

View duaneleem's full-sized avatar
Converting Coffee to Code, Daily

Duane Leem duaneleem

Converting Coffee to Code, Daily
View GitHub Profile
var gulp = require('gulp'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
uglify = require('gulp-uglify'),
usemin = require('gulp-usemin'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
@duaneleem
duaneleem / .bash_profile
Last active August 9, 2016 01:24
Helper bash functions to automate git workflow. On Mac OS X type "git-all -m "Updated app." and it will git add/commit/push. You can update gh-pages using "git-pages" from bash and will update your gh-pages based on master repo.
# GitHub Automation
gitAll() {
git add .
git commit -m "$1"
git push
}
alias git-all=gitAll
gitPages() {
git checkout gh-pages
@duaneleem
duaneleem / Dockerfile
Last active August 9, 2016 21:04
This build is used for live-reload development purposes (HTML / CSS / JS Stack)
## This build is used for live-reload development purposes. You MUST
## mount a volume back to your working directly upon creation.
FROM ubuntu:16.04
MAINTAINER Duane Leem <duaneleem@alumni.ggu.edu>
## Making a random directory to -v mount the container to later.
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
@duaneleem
duaneleem / forced-reboot.bat
Last active November 16, 2016 18:41
Forces a Windows PC to reboot automatically.
REM Forces a Windows PC to reboot automatically.
shutdown /r /t 0
@duaneleem
duaneleem / gitignore
Last active March 3, 2017 00:17
.gitignore aliases for lazy devs
[alias]
# Pushes to gh-pages then switches back to master
pagespush = "!git add . && git commit -m 'Updated content.' && git push && git checkout gh-pages && git merge master && git push origin gh-pages && git checkout master"
# Update local/remote repo; delete gh-pages; and push dist folder to gh-pages. Great for Angular projects.
distpush = "!git add . && git commit -m 'Updated content.' && git push && git push origin --delete gh-pages && git subtree push --prefix dist origin gh-pages"
@duaneleem
duaneleem / 0_reuse_code.js
Created June 20, 2017 14:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@duaneleem
duaneleem / example.ts
Created September 13, 2017 17:51
Try/Catch example.
export class TryCatchExample {
mtdExample() {
try {
for (editIndex = 0; editIndex < partner.objProjects.length; editIndex++)
{
if (partner.objProjects[editIndex].id == req.body.projectId) {found = true; break;}
}
if (!found)
{
@duaneleem
duaneleem / example.ts
Created September 13, 2017 17:53
Code Documentation
/** Class representing a point. */
class Point {
/**
* Create a point.
* @param {number} x - The x value.
* @param {number} y - The y value.
*/
constructor(x, y) {
// ...
}
@duaneleem
duaneleem / dentrix-chart.bat
Last active September 24, 2017 17:58
Dentrix G5 script to fix slow chart loads. Run this AFTER renaming/deleting C:\Program Files (x86)\Dentrix\Cust\Chart.Startup
::Make sure registry commands are not disabled or windows is damaged
reg /?
if errorlevel 1 (
GOTO SYSTEMREPAIR
)
if errorlevel 0 (
GOTO HI
)
@duaneleem
duaneleem / aws-lambda.js
Created November 13, 2017 22:10 — forked from MrRoyce/gist:097edc0de2fe001288be2e8633f4b22a
AWS CodeDeploy Lamda formatter for Slack messages - node.js
var services = '/services/...'; // Update this with your Slack service...
var channel = "#aws-deployments" // And this with the Slack channel
var https = require('https');
var util = require('util');
var formatFields = function(string) {
var
message = JSON.parse(string),
fields = [],