Author: Chris Lattner
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 | |
/** | |
* imageColor | |
* | |
* Shows three methods to find the 'average' image color. | |
* | |
* Each function expects a gd image object. | |
* | |
* imageColor::averageResize($image) resizing to 1px, and checking the color. | |
* imageColor::averageBorder($image) find the average color of all border pixels. |
One of my clients is a big company that has a very variable but predictable database usage pattern.
In the weekdays morning they come up with a huge amount of INSERTs and UPDATEs while for the rest of the day, form noon on,
the usage is fairly limited to a decent amount of SELECTs with very low writing activity.
The smallest class type that can handle the morning's volume is db.r3.large
but having such an instance running all day long and in the weekends is just a big waste of resources money
(or a big favour we do to Amazon, from their point of view).
So I was wondering if there's some autoscaling mechanism for Aurora writers (there is, but only for replicas),
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
{ | |
"name" : "rarst/install-test", | |
"description" : "Test project for WordPress stack via Composer", | |
"authors" : [ | |
{ | |
"name" : "Andrey Savchenko", | |
"homepage": "http://www.Rarst.net/" | |
} | |
], | |
"type" : "project", |
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
/** | |
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded | |
* templates and such with AngularJS. Use this simple directive to | |
* tame this beast once and for all. | |
* | |
* Usage: | |
* <input type="text" autofocus> | |
* | |
* License: MIT | |
*/ |
Put test1.js
and test2.js
into a tests/
directory, then run the suite:
$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
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
// jQuery.support.transition | |
// to verify that CSS3 transition is supported (or any of its browser-specific implementations) | |
$.support.transition = (function(){ | |
var thisBody = document.body || document.documentElement, | |
thisStyle = thisBody.style, | |
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; | |
return support; | |
})(); |
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 | |
usage(){ | |
echo "Usage: `basename $0` [-h] [-r] [-t testOptions] [<directory>...]\n" | |
echo ' -h Show this help message.' | |
echo ' -r Remove the default directories, and only use the ones provided. Without the flag, the provided directories will be appended to the default list.' | |
echo ' -t Options to pass to "grails test-app". Default: none.' | |
echo ' See: http://grails.org/doc/latest/ref/Command%20Line/test-app.html' | |
} | |
# Parse the arguments |
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
language: groovy | |
jdk: | |
- oraclejdk6 | |
env: | |
- GRAILS_VERSION=2.2.4 | |
- GRAILS_VERSION=2.2.3 | |
- GRAILS_VERSION=2.2.2 | |
- GRAILS_VERSION=2.2.1 |