This file contains hidden or 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
input[type=radio] { | |
position: absolute; | |
top: -9999px; | |
left: -9999px; | |
} | |
label { | |
cursor: pointer; | |
text-align: center; | |
font-family: sans-serif; |
This file contains hidden or 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
/* Checkbox Hack */ | |
input[type=checkbox] { | |
position: absolute; | |
top: -9999px; | |
left: -9999px; | |
} | |
label { | |
-webkit-appearance: push-button; | |
-moz-appearance: button; |
This file contains hidden or 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
Array.prototype.foreach = function(action) { | |
for (var i = 0; i < this.length; i++) { | |
action(i, this[i]); | |
} | |
}; | |
var arr = [1,2,3,4]; | |
arr.foreach(function(i,item){ | |
$('#log').append('<p>'+item+'</p>'); |
This file contains hidden or 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
/* | |
* Foreach | |
* Example: | |
* var arr = [1,2,3,4]; | |
* arr.foreach(function(i,item) { | |
* console.log(i, item); | |
* }); | |
* | |
*/ | |
Array.prototype.foreach = function(action) { |
This file contains hidden or 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
chrome://net-internals/#dns | |
Just a quick tip for those who need to clear Chrome's DNS cache only. The method for "Empty the cache" under "Clear Browsing Data" clear both files caches and DNS caches. | |
To just clear the DNS cache, type this into the browser: chrome://net-internals/#dns |
This file contains hidden or 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
/* | |
* Take a string and wrap any terms with some container (like <span>) | |
* Nothing complicated. It splits a string on ',' (comma) and 'and', and adds the desired wrapper around the resulting terms. | |
*/ | |
var str = 'Web Developer and Front-End Engineer and All around cool guy'; | |
String.prototype.wrapTermsWith = function(wrap) { | |
var delimiters = [',', ' and '], | |
wrapper = wrap.split('><'), |
This file contains hidden or 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
/* | |
* Where I work, I thought it would come in handy to have a | |
* collection of methods that I could apply to native JS | |
* objects, like strings. | |
* | |
* While it would be useful to do this: | |
*/ | |
String.prototype.touch = function() { | |
return this + ' has been touched'; |
This file contains hidden or 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 first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
This file contains hidden or 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 | |
class CalculatorTest extends PHPUnit_Framework_TestCase { | |
public function testAdd() { | |
$c = new Calculator; | |
$result = $c->add(5, 10); | |
$this->assertEquals(15, $result); | |
} | |
} |
This file contains hidden or 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
#watchr script | |
# $ watchr ./autotest_watchr.rb | |
# depends on Growl and growlnotify | |
watch("Classes/(.*).php") do |match| | |
run_test %{Tests/#{match[1]}Test.php} | |
end | |
watch("Tests/.*Test.php") do |match| | |
run_test match[0] |
OlderNewer