Skip to content

Instantly share code, notes, and snippets.


Rahmin Pavlovic rpavlovic

  • Ernst & Young
  • NYC
View GitHub Profile
rpavlovic / create_time_zone.sql
Created February 15, 2015 13:59
Create Time Zone Tables
View create_time_zone.sql
CREATE TABLE `time_zone` (
`Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`Time_zone_id`)
CREATE TABLE `time_zone_leap_second` (
`Transition_time` bigint(20) NOT NULL,
`Correction` int(11) NOT NULL,
PRIMARY KEY (`Transition_time`)
rpavlovic / recommended_innodb.sql
Last active September 8, 2015 14:39
Query to recommended InnoDB buffer pool
View recommended_innodb.sql
View git-fork-sync
usage() {
echo "$0 usage:"
echo ""
echo " $0 [options]"
echo ""
echo "Where [options] include:"
echo ""
echo " -h|--help Show this help"
rpavlovic / server.js
Created February 12, 2015 18:15
simple Node.js server
View server.js
// A very basic web server in node.js
// Stolen from: Node.js for Front-End Developers by Garann Means (p. 9-10)
var port = 8000;
var serverUrl = "";
var http = require("http");
var path = require("path");
var fs = require("fs");
rpavlovic /
Created February 2, 2015 16:49
search directory of .zip files for file(s) containing text
for file in *.zip; do unzip -c "$file" | grep "text to find" && echo $f;
rpavlovic / list_props.js
Created January 31, 2015 19:02
Use JavaScript to list any/all properties of any JS object (native or custom)
View list_props.js
Each browser/device has their set of JS properties (some more secret than others)
Use JavaScript to list any/all properties of any JS object (native or custom)
An old method of mine from the "browser wars"
var logger = logger || {
getProperties : function(obj) {
var props = [];
for(var n in obj) {
var prop = obj.toString() + "." + n;
rpavlovic / wp_average_comments.sql
Created January 29, 2015 14:43
Wordpress SQL: average comments per day over time
View wp_average_comments.sql
'2010-11-24' AS date_begin,
'2015-01-26' AS date_end,
AVG(comment_count) AS average_comments
DAYNAME(comment_date) day_of_week,
DAYOFWEEK(comment_date) day_num,