This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`) | |
) ENGINE=MyISAM AUTO_INCREMENT=1676 DEFAULT CHARSET=utf8 COMMENT='Time zones'; | |
CREATE TABLE `time_zone_leap_second` ( | |
`Transition_time` bigint(20) NOT NULL, | |
`Correction` int(11) NOT NULL, | |
PRIMARY KEY (`Transition_time`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SELECT @@innodb_buffer_pool_size; | |
# SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) buffer_pool_gigs FROM (SELECT SUM(data_length+index_length) Total_InnoDB_Bytes FROM information_schema.tables WHERE engine='InnoDB') A; | |
SELECT CONCAT(ROUND(KBS/POWER(1024, IF(PowerOf1024<0,0,IF(PowerOf1024>3,0,PowerOf1024)))+0.49999), SUBSTR(' KMG',IF(PowerOf1024<0,0, IF(PowerOf1024>3,0,PowerOf1024))+1,1)) recommended_innodb_buffer_pool_size FROM (SELECT SUM(data_length+index_length) KBS FROM information_schema.tables WHERE engine='InnoDB') A, (SELECT 2 PowerOf1024) B; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() { | |
echo "$0 usage:" | |
echo "" | |
echo " $0 [options]" | |
echo "" | |
echo "Where [options] include:" | |
echo "" | |
echo " -h|--help Show this help" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 = "127.0.0.1"; | |
var http = require("http"); | |
var path = require("path"); | |
var fs = require("fs"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in *.zip; do unzip -c "$file" | grep "text to find" && echo $f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
'2010-11-24' AS date_begin, | |
'2015-01-26' AS date_end, | |
day_of_week, | |
AVG(comment_count) AS average_comments | |
FROM ( | |
SELECT | |
comment_date, | |
DAYNAME(comment_date) day_of_week, | |
DAYOFWEEK(comment_date) day_num, |