A d3 worldmap with own regions, defined by the iso 3166-1 (alpha-3) country code. Uses topojson.merge().
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
function responsiveImages($string, $attr) { | |
$output = "<div id=\"responsive-gallery-test\">"; | |
$posts = get_posts(array('include' => $attr['ids'], 'post_type' => 'attachment')); | |
foreach ($posts as $image) { | |
$output .= "<img data-img-small='" . wp_get_attachment_image_src($image->ID, 'thumbnail')[0] . "'" . | |
" data-img-medium='" . wp_get_attachment_image_src($image->ID, 'medium')[0] . "''" . | |
" data-img-large='" . wp_get_attachment_image_src($image->ID, 'large')[0] . "''" . | |
" data-img-full='" . wp_get_attachment_image_src($image->ID, 'full')[0] . "'/>"; | |
} |
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
import glob | |
import email | |
if __name__ == '__main__': | |
files = glob.glob("/Users/wiesson/Downloads/mails/*.eml") | |
for each in files: | |
msg = email.message_from_file(open(each)) | |
attachments = msg.get_payload() | |
for attachment in attachments: | |
try: |
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
(moment('2015-04-25').add(6, 'months')).diff(moment(), 'days') |
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
add_image_size('img-l', 1024, 702); | |
add_image_size('img-m', 768, 372); | |
add_image_size('img-s', 480, 320); | |
add_image_size('img-xs', 320, 200); | |
/** | |
* Get WP Attachment as responsive background image | |
* @param int $id | |
* @return string | |
*/ |
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 | |
if (!extension_loaded('xmlrpc')) { | |
echo "PHP xmlrpc extension is not available."; | |
die; | |
} | |
function call($remoteUri, $localUri, $username, $password) | |
{ | |
$requestParameter = array( | |
'RemoteUri' => sprintf('sip:%[email protected]', $remoteUri), |
Faux-3d SVG globe using d3.geo.orthographic and a few radial gradients. Labels offset or hidden based on radians from current map center to enhance the effect.
Uncomment svg.append("g").attr("class","countries") for hover-able country outlines.
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
""" | |
Lsg: | |
43726 - 1589 = 42137 | |
43789 - 1652 = 42137 | |
47326 - 5189 = 42137 | |
47398 - 5261 = 42137 | |
""" | |
from random import shuffle | |
while True: |
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
SELECT CONCAT('ALTER TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ' engine=InnoDB;') FROM information_schema.TABLES WHERE ENGINE = 'MyISAM'; |