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
## Reordering layers | |
I'm working on a command that creates a rectangle in the background of a text layer (with slightly larger dimensions than the text). For that, I need to manipulate the generated layer's z-order, but couldn’t find anything to that extent in the docs. `group.layers()`, as an `MSArray`, also doesn’t expose methods that could do the trick such as `exchangeObjectWithIndex:withIndex:`. | |
As a workaround I'm using a [technique lifted from sketch-style-inventory][INV]: calculating the offset of two layers and then doing a bunch of `NSApp.sendAction_to_from('moveForward:', nil, context.doc);` calls. But that seems hacky at best, feels like there should be a proper API for the common usecase of wanting to manipulate z-order of layers (or is there an undocumented way?). | |
## Expanding frames | |
The [MSRect docs][MSRECT] have a code example for `expandBy:` that I tried to emulate, but failed, that method doesn’t seem to exist on either `MSRect` or `GKRect`: |
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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by libvorbis configure 1.3.1, which was | |
generated by GNU Autoconf 2.61. Invocation command line was | |
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/libvorbis/1.3.1 | |
## --------- ## | |
## Platform. ## |
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
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.3.1.tar.bz2 | |
File already downloaded and cached to /Users/gerrit/Library/Caches/Homebrew | |
==> make prefix=/usr/local/Cellar/git/1.7.3.1 install | |
Exit status: 2 | |
http://github.com/mxcl/homebrew/blob/master/Library/Formula/git.rb#L31 | |
==> Environment | |
HOMEBREW_VERSION: 0.7 | |
HEAD: 09a02645fcf1aa3313f631174016e36917539a6e |
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 'less' | |
module Jekyll | |
class Less < Converter | |
safe true | |
priority :low | |
def matches(ext) | |
ext =~ /less/i | |
end |
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 'osx/cocoa' | |
include OSX | |
class Screen | |
class << self | |
def resize(width, height, &block) | |
new.resize(width, height, &block) | |
end | |
end |
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 'osx/cocoa' | |
class Screen | |
class << self | |
def resize(width, height, &block) | |
new.resize(width, height, &block) | |
end | |
end | |
def initialize(screen = OSX::CGMainDisplayID()) |
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 'active_support/cache/dalli_store23' | |
config.cache_store = :dalli_store | |
config.middleware.use ::Radiant::Cache, | |
:metastore => "memcached://#{ENV['MEMCACHE_SERVERS']}:11211/meta", | |
:entitystore => "memcached://#{ENV['MEMCACHE_SERVERS']}:11211/body" |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# Developed using Ruby 1.9.3, should run under any version of Ruby 1.9 | |
# Create a small command line game in Ruby that does the following: | |
# | |
#- Player 1 enters a letter. The program uses the google api to search for that | |
# letter and outputs the number of search results. - Player 2 adds a letter. | |
# The program displays the whole series of letters and outputs the number of |
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
getScript = jQuery.getScript; | |
jQuery.getScript = ( resources, callback )-> | |
deferreds = [] | |
counter = 0 | |
for resource in resources deferreds.push getScript( resource, -> counter++ ) | |
jQuery.when.apply( null, deferreds ).then -> callback && callback(); | |
deps = [ | |
"http://documentcloud.github.com/backbone/backbone-min.js", |