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
/* Save this file with a jsx extension and place in your | |
Illustrator/Presets/en_US/Scripts folder. You can then | |
access it from the File > Scripts menu */ | |
var decimalPlaces = 3; | |
if (app.documents.length > 0) { | |
if (app.activeDocument.selection.length < 1) { | |
alert('Select a path'); |
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
require('dotenv').config() | |
const express = require('express') | |
const fetch = require('node-fetch') | |
const app = express() | |
app.use('/', async (req, res) => { | |
// Attachment URL | |
const attachmentURL = "https://trello.com/1/cards/5e65954f0f343116e999658f/attachments/5e67a146876719748d64057b/previews/5e67a147876719748d6405ae/download" |
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
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 |
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
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; |
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 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) |
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 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) |
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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<!-- Test image --> | |
<img src="http://m1.22slides.com/bryanbuchanan/4317_image_374612.jpg" alt="Image"> |
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 | |
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, |
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
// 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, |
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
// Function | |
function retinaCanvas($canvas, context) { | |
$canvas.each(function() { | |
$(this).prop({ | |
width: $(this).width() * 2, | |
height: $(this).height() * 2 | |
}); | |
context.scale(2,2); | |
}); | |
} |
NewerOlder