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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Hungry Kid!</title> | |
<style type="text/css"> |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Drag and Drop</title> | |
<style type="text/css"> | |
body { | |
margin:15px; | |
padding:0; |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title>Hungry Kid!</title> | |
<style type="text/css"> |
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
<script type="text/javascript"> | |
// See MDN: https://developer.mozilla.org/en-US/docs/DOM/MutationObserver?redirectlocale=en-US&redirectslug=DOM%2FDOM_Mutation_Observers | |
(function(){ | |
// select the target node | |
var target = document.querySelector('body'); | |
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; | |
var i=0; | |
// create an observer instance | |
var observer = new MutationObserver(function(mutations) { |
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 | |
function nbspBetweenLastWords( $text, $minWords = 3 ) { | |
if (substr_count($text, ' ') >= $minWords - 1) { | |
return substr_replace($text, ' ', strrpos($text, ' '), 1); | |
} | |
return $text; | |
} |
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 | |
/** | |
* Dominant colours by k means derived from code by Charles Leifer at: | |
* http://charlesleifer.com/blog/using-python-and-k-means-to-find-the-dominant-colors-in-images/ | |
* | |
* MagickWand docs: http://www.magickwand.org/ | |
* | |
* Color transformation algorithms from EasyRGB: http://easyrgb.com/ | |
* |
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
class someclass | |
{ | |
private $items; | |
function filterItemsUsingForeach() | |
{ | |
$criterion = 'somevalue'; | |
$items = array(); | |
foreach ($this->items as $item) { | |
if (method_exists($item, 'someMethod') && $item->someMethod() == $criterion) { |
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
//Data provider functionality in jasmine | |
//see http://blog.jphpsf.com/2012/08/30/drying-up-your-javascript-jasmine-tests | |
function using(name, values, func){ | |
for (var i = 0, count = values.length; i < count; i++) { | |
if (Object.prototype.toString.call(values[i]) !== '[object Array]') { | |
values[i] = [values[i]]; | |
} | |
func.apply(this, values[i]); | |
jasmine.currentEnv_.currentSpec.description += ' (with "' + name + '" using ' + values[i].join(', ') + ')'; | |
} |
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
# Open the current file in Chrome in OSX from Vim | |
# Add this to ~/.vimrc | |
# Usage: `:Browse` | |
command Browse execute "!/usr/bin/open -a \"/Applications/Google Chrome.app\"" expand('%:p') |
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
import boto | |
from boto.s3.key import Key | |
class Ilabcode: | |
def create_bucket(self, s3_client, bucket_name, region): | |
pass | |
def put_object(self, s3_client, bucket_name, source_file_name, object_key): | |
pass |
OlderNewer