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
# Example MySQL config file for medium systems. | |
# | |
# This is for a system with little memory (32M - 64M) where MySQL plays | |
# an important part, or systems up to 128M where MySQL is used together with | |
# other programs (such as a web server) | |
# | |
# You can copy this file to | |
# /etc/my.cnf to set global options, | |
# mysql-data-dir/my.cnf to set server-specific options (in this | |
# installation this directory is /Applications/MAMP/db/mysql) or |
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
$sql = "SELECT * FROM alpha WHERE letter REGEXP '%s' ORDER BY letter DESC;"; | |
$letter = 'LL'; | |
$regex = '^'.$letter.'$|^[A-'.(strlen($letter) > 1 ? substr($letter, -1) : chr(ord(substr($letter, -1)) - 1)).'].?$'; | |
echo sprintf($sql, $regex); |
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
$(document).ready(function() { | |
var speedLimit = 4; // higher allows the spin to jump frames faster. More speed. | |
var sensitivity = 10; // higher numbers makes it *less* sensitive, i.e. get to the speed limit slower. | |
var dragCoefficient = 3; // higher numbers = more drag. Slows down faster after a drag-to-spin. % of speed to lose. | |
$.fn.animator = function() { | |
var that = this; | |
that.container = $(this).find('.frame-container'); | |
that.frames = that.container.children(); | |
that.totalFrames = that.frames.length - 1; |
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 | |
# name: rarsync - Remote Asset Rsync | |
# author: jamesp@teamddm.com | |
# date: 2012-01-23 | |
# version 0.9.2 | |
DEST_PATH=$2 | |
DEST_REMOTE=0 | |
SOURCE_PATH=$1 |
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 | |
# This script will loop through a set of servers and print their load average, | |
# memory usage statistics and cpu statistics | |
# If a servers load average is in a warning or critical level, the text color | |
# of the host and the load average change to yellow (warning) or red (critical) | |
# The primary SSH Command has a timeout feature in it. If your server is under | |
# load and cannot respond fast enough, the script will alert on connection timeout. | |
# If you are running this script on a Mac, it will notify you by running `say` | |
# and bringing the terminal windows to the front |
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
<?php | |
/** | |
* | |
* PHP JSON Echo Server client | |
* | |
*/ | |
// python server socket | |
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
socket_connect($socket, 'localhost', 5555); |
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
$(document).ready(function() { | |
$.fn.animator = function() { | |
var that = this; | |
var tabID = '#' + $(this).attr('id'); | |
var frameCount = $(this).find('.frame-container').children('.frame').length; | |
var steps = Math.floor(frameCount + 1); | |
var slider = $(this).find('.dragdealer').attr('id'); | |
var middle = Math.ceil(steps / 2.001); |
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
// Extend jQuery.support to test for placeholder support | |
$.support.placeholder = false; | |
test = document.createElement('input'); | |
if('placeholder' in test) $.support.placeholder = true; | |
// If the placeholder attribute is not supported | |
// ref: http://www.cssnewbie.com/cross-browser-support-for-html5-placeholder-text-in-forms/ | |
if(!$.support.placeholder) { | |
// save the active element for future reference | |
var active = document.activeElement; |
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
<?php | |
$data = array( | |
'title' => 'My Form', | |
'action' => 'new', | |
'file' => '@/path/to/file.pdf', | |
); | |
$ch = curl_init(); |
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
var popupCarousel = function() { | |
$('#popupContainer div').hide(); | |
$('#popupContainer div').first().show(); | |
$('a.prev, a.next').css('cursor', 'pointer'); | |
var stor = 0; | |
var maxstor = ($('#popupContainer div').get().length - 1); | |
var lastShownStor = 0; | |
var popups = $('#popupContainer div').get(); | |