Skip to content

Instantly share code, notes, and snippets.

View turntayble81's full-sized avatar

Haig Papaghanian turntayble81

  • Detroit, MI
View GitHub Profile
var schema = {
'bankLogins': {
dynamodbTable : 'loans',
primaryKey : ['loanId', 'recordId'],
indexes: {
loanId : {
column : 'loanId'
},
loanId : {
column : 'recordId'
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "QLoans production cloud formation template",
"Parameters" : {
"envName": {
"Default": "test",
"Description": "Friendly tag for environment",
"Type": "String"
},
"domain": {
var router = exports,
fs = require('fs');
router.init = function(parent, map) {
var controllers = [],
_this = this;
function _loadControllers() {
fs.readdirSync(parent.get('controllers')).forEach(function(name) {
controllers[name.replace(/\.js$/, '')] = require(parent.get('controllers') + '/' + name);
<div class="span5">
<h3>User Profile Image</h3>
<div class="help-block">Chose your profile image.<br />jpg, png, gif</div>
<div id="divUserProfileImages" class="userProfileImageContainer">
<?php echo isset($userProfileImages) ? $userProfileImage : ""; ?>
</div>
<form class="form-stacked" method="post" action="/images/process_image_upload" enctype="multipart/form-data" target="image_upload_target">
<fieldset>
<span id="userProfileImgUploadErr" class="errorMesg"></span><br />
@turntayble81
turntayble81 / server-monitor.sh
Created March 14, 2012 15:21
Apache/MySQL tuning script
#!/bin/bash
freeMem=`mysql --defaults-file=/root/.my.cnf -s -e "SHOW STATUS WHERE Variable_name='Qcache_free_memory'" | awk '{print $2}'`;
totalMem=`mysql --defaults-file=/root/.my.cnf -s -e "SHOW VARIABLES WHERE Variable_name ='query_cache_size'" | awk '{print $2}'`;
usedMem=$((totalMem-freeMem));
freePct=$(echo "scale=4;($freeMem/$totalMem) * 100" | bc);
freePct=`echo $freePct | awk '{ printf "%.0f\n", $1 }'`;
usedPct=$(echo "scale=4;($usedMem/$totalMem) * 100" | bc);
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Layout
{
var $obj;
var $layout;
function Layout($layout = "layout/main")
DROP TABLE IF EXISTS `label_subscription_offerings`;
CREATE TABLE IF NOT EXISTS `label_subscription_offerings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`label_id` int(11) NOT NULL,
`merchant_plan_id` varchar(255) NOT NULL,
`subscription_type` int(11) NOT NULL,
`active` tinyint(4) NOT NULL,
`price` decimal(10,2) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;