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/sh | |
# | |
# Script to prepare and restore full and incremental backups created with innobackupex-runner. | |
# | |
# This script is provided as-is; no liability can be accepted for use. | |
# | |
INNOBACKUPEX=innobackupex-1.5.1 | |
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX | |
TMPFILE="/tmp/innobackupex-restore.$$.tmp" |
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/sh | |
# | |
# A hook to disallow php syntax errors to be committed | |
# by running php -l (lint) on them. It requires php-cli | |
# to be installed. | |
# | |
# Credits to https://github.com/phpbb/phpbb, https://raw.github.com/phpbb/phpbb/develop-olympus/git-tools/hooks/pre-commit | |
# | |
# This is a pre-commit hook. | |
# |
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
// Stupid IE Fixes | |
var alertFallback = true; | |
if (typeof console === "undefined" || typeof console.log === "undefined") { | |
console = {}; | |
if (alertFallback) { | |
console.log = function(msg) { | |
alert(msg); | |
}; | |
} else { | |
console.log = function() {}; |
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
## Xcode | |
Install Xcode | |
Head to the Apple Developer Center to download a copy of the latest Xcode | |
* [Apple Developer Center](http://developer.apple.com/technologies/xcode.html) | |
xcode-select --install | |
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
// Parse the query string | |
var params = {}, queryString = location.hash.substring(1), | |
regex = /([^&=]+)=([^&]*)/g, m; | |
while (m = regex.exec(queryString)) { | |
params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); | |
} |
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/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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
TRUNCATE is usually a fast operation (much faster than DELETE FROM). But sometimes it just hangs; | |
TRUNCATE on tables with no FOREIGN KEYs should act fast: it translate to dropping the table and creating a new one (and it all depends on the MySQL version, see the manual). | |
Renaming a table (without Foreign Keys) is much faster if its large enough. Instead of: | |
``` | |
TRUNCATE log_table | |
``` | |
Do: | |
``` |
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
/********************************************************************************************* | |
Remove duplicate entries / rows a mySQL database table | |
Credit To: | |
http://www.justin-cook.com/wp/2006/12/12/remove-duplicate-entries-rows-a-mysql-database-table/ | |
**********************************************************************************************/ | |
/************************************************************************** | |
Step 1: Move the non duplicates (unique tuples) into a temporary table | |
***************************************************************************/ | |
CREATE TABLE new_table LIKE old_table; |
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
package jdaily | |
import play.api.Play | |
import play.api.Play.current | |
import play.api.libs.json._ | |
import play.api.libs.json.Reads._ | |
import play.api.libs.functional.syntax._ | |
/** | |
* Created by jdaily on 1/27/14. |
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
package jdaily | |
import play.api.libs.json._ | |
import org.joda.time.{DateTimeZone, DateTime, LocalDateTime} | |
/** | |
* Created by jdaily on 5/04/14. | |
*/ | |
object MongoDateTime { |
OlderNewer