Forked from A Non Ymous's Pen sJAdx.
A Pen by Bryan Buchanan on CodePen.
Forked from A Non Ymous's Pen sJAdx.
A Pen by Bryan Buchanan on CodePen.
// Logger only works when develop == true | |
var develop = true; | |
function log(message, line) { | |
if (window.console && window.log && develop) { | |
var line = typeof line !== "undefined" ? line : false; | |
if (line) { | |
if (typeof message === "string") { | |
console.log(message + " (Line " + line + ")"); | |
} else { |
// Function | |
function retinaCanvas($canvas, context) { | |
$canvas.each(function() { | |
$(this).prop({ | |
width: $(this).width() * 2, | |
height: $(this).height() * 2 | |
}); | |
context.scale(2,2); | |
}); | |
} |
// Function | |
function lltoXY(options) { | |
var x = (options.lon + 180) * (options.width / 360); | |
var y = ((options.lat * -1) + 90) * (options.height / 180); | |
return { x: x, y: y }; | |
} | |
// Usage | |
var position = lltoXY({ | |
lat: 25.26, |
<?php | |
if (isset($_POST)) { | |
// Get user ID | |
$user_id = $_POST['user_id']; | |
// Data to send to Flickr API | |
$data = array( | |
"method" => "flickr.people.getInfo", | |
"user_id" => $user_id, |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<!-- Test image --> | |
<img src="http://m1.22slides.com/bryanbuchanan/4317_image_374612.jpg" alt="Image"> |
import os | |
import sys | |
directory = os.path.dirname(os.path.realpath(sys.argv[0])) | |
for subdir, dirs, files in os.walk(directory): | |
for filename in files: | |
if filename.find('old_suffix_1') > 0: | |
subdirectoryPath = os.path.relpath(subdir, directory) | |
filePath = os.path.join(subdirectoryPath, filename) |
import os | |
import sys | |
directory = os.path.dirname(os.path.realpath(sys.argv[0])) | |
for dirpath, dirnames, files in os.walk(directory): | |
if not files: | |
os.rmdir(dirpath) |
imgLoader = new Image(); | |
imgLoader.onload = function(data) { | |
// Desired size | |
var max_width = 600; | |
var max_height = 600; | |
// Get image dimensions | |
var original_width = imgLoader.width; | |
var original_height = imgLoader.height; |
title: Mesa # Human-readable theme name to be used in UI | |
name: mesa # camelCase theme name to be used by system | |
image: image.jpg # Name of theme preview image file | |
options: # List of categories of customizable properties | |
- name: logo | |
title: Logo | |
properties: | |
- image: true | |
name: logoImage |