Skip to content

Instantly share code, notes, and snippets.

View genediazjr's full-sized avatar
🎱
foobar

Gene Diaz genediazjr

🎱
foobar
View GitHub Profile
@genediazjr
genediazjr / SerializeObject.js
Last active December 31, 2015 11:59
prepare form objects for JSON.stringify
$.fn.serializeObject = function () {
var o = {};
var a = this.serializeArray();
$.each(a, function () {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
@genediazjr
genediazjr / .gitignore
Last active December 31, 2015 11:59
Gitignore Preset
.DS_Store
.lock-wscript
.komodotools
.classpath
.settings
.project
.dropbox
.tmproj
.grunt
.cache
@genediazjr
genediazjr / yyyyMMddHHmmssSSS_Timestamp.js
Last active December 31, 2015 11:59
A simple yyyyMMddHHmmssSSS timestamp generator
function getTimestamp () {
var date = new Date();
var year = date.getFullYear();
var month = (date.getMonth() + 1) + '';
var day = date.getDate() + '';
var hr = date.getHours() + '';
var min = date.getMinutes() + '';
var sec = date.getSeconds() + '';
var ms = date.getMilliseconds() + '';
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
};
function guid() {
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
@genediazjr
genediazjr / deploy.sh
Last active December 31, 2015 16:29
Tomcat deployment script on Debian EC2
#!/bin/sh
echo "\n Killing the cat..."
/etc/init.d/tomcat7 stop
echo "\n Removing internal organs..."
rm -rf /var/lib/tomcat7/webapps/ROOT
rm -rf /var/lib/tomcat7/webapps/ROOT.war
echo "\n Placing new organs..."
.text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
text-shadow: @string;
}
.box-shadow (@string) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string;
}

Keybase proof

I hereby claim:

  • I am genediazjr on github.
  • I am genediazjr (https://keybase.io/genediazjr) on keybase.
  • I have a public key whose fingerprint is 8D41 E3C8 4BC3 B215 55F8 B2ED 1CFB 146E 169C 4E41

To claim this, I am signing this object:

Verifying that +genediazjr is my blockchain ID. https://onename.com/genediazjr
@genediazjr
genediazjr / .bash_profile
Last active February 6, 2016 00:35 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
{
"excludeFiles": [
"node_modules"
],
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",