Skip to content

Instantly share code, notes, and snippets.

View iamakimmer's full-sized avatar

Matthew Kim iamakimmer

View GitHub Profile
@iamakimmer
iamakimmer / New Order Template
Created September 20, 2017 21:15
Email Template
Template Name: New Order Email
Template Subject: {{var store.getFrontendName()}}: New Order # {{var order.increment_id}}
Template Content
{{template config_path="design/email/header"}}
{{inlinecss file="email-inline.css"}}
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
@iamakimmer
iamakimmer / delete_old_sessions
Last active September 11, 2017 18:42
SMU delete old session files #JavaScript
#delete sessions older than 90 days in public_html folder
find var/session/* -mtime +90 -exec rm {} \;
//INITIALIZES THE NPM PACKAGES USED//
var mysql = require('mysql');
var inquirer = require('inquirer');
//INITIALIZES THE CONNECTION VARIABLE TO SYNC WITH A MYSQL DATABASE//
var connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root", //Your username//
password: "", //Your password//
@iamakimmer
iamakimmer / OnKeyUp.js
Created June 8, 2016 04:04
Onkeyup & keypress
document.onkeyup = function(event) {
var keypress = String.fromCharCode(event.keyCode).toLowerCase();
};
localStorage.clear(); //clears all data from localStorage
localStorage.setItem('name', 'john'); //set name to john
localStorage.setItem('user_id', '124242'); //set user_id to 124242
var n = localStorage.getItem('name'); //returns name and set to variable n;
var u = localStorage.getItem('user_id'); //returns 124242 and set to variable u;
console.log(n) //john
@iamakimmer
iamakimmer / 0_reuse_code.js
Created June 5, 2016 14:57
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
// will not save updated date
doc.eventDate.setDay(10);
doc.save();
// will save updated date
doc.eventDate.setDay(10);
doc.markModified('eventDate');
doc.save();
document.mynumberlist.set(0, 2);
document.save();
document.mynumberlist[0] = 2;
document.markModified('mynumberlist'); //notify mongoose of the change
document.save();
document.mynumberlist[0] = 2;
document.save();