Note: This post is a summary of information paraphrased from an excellent blog post by Christian Sepulveda.
Create the app and download the necessary dependencies.
Create the app and download the necessary dependencies.
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
// by d whyte | |
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>SKVariables</key> | |
<array> | |
<dict> | |
<key>enabled</key> | |
<true/> | |
<key>name</key> |
//viewDidload | |
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { | |
// iOS 7 | |
[self prefersStatusBarHidden]; | |
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; | |
} else { | |
// iOS 6 | |
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; | |
} |
/* | |
* http://christian-fei.com/tutorials/how-to-lazy-load-disqus-comments/ | |
* | |
* <div class="comments"></div> | |
*/ | |
var comments = document.getElementsByClassName('comments')[0], | |
disqusLoaded = false; | |
function loadDisqus() { |
Here's what I told the last person that asked about how to get started with Photoshop panel development. One day I'll write a good version of this. | |
I'll warn you, Photoshop development is a real headache. There is a lot of stuff to try to figure out, but stick with it! It's worth it. | |
Is the flex part Easy , i mean the interaction part (the interface build must be easy) | |
Flex is basically XML. You can create most of it by dragging and dropping components if you don't want to customize the UI. | |
So during the install you install the panel plus a script ? | |
Essentially yes. For the most basic panel there is a panel file (.swf), script file (.jsx), and icon files (.png). You can even do the panel without the script file, though doing so limits you mostly to CS5. |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |