This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
# sudo ln -s ~/nginx.conf unicorn.conf | |
upstream app_server { | |
server unix:/tmp/unicorn_padrino.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
charset utf-8; | |
server_name db.innshine.com; |
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration
Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:
block = lambda { |param| ... }
# LiquidView is a action view extension class. You can register it with rails | |
# and use liquid as an template system for .liquid files | |
# | |
# Example | |
# | |
# ActionView::Base::register_template_handler :liquid, LiquidView | |
class LiquidView | |
PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template | |
_response url _request _cookies variables_added _flash params _headers request cookies | |
ignore_missing_templates flash _params logger before_filter_chain_aborted headers ) |
It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media
This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.
#!/bin/bash | |
# This OS X script reads the disk, calculates it's checksum, and then compares | |
# it to the checksum of the original image. | |
# Was written originally to verify burned images of XBox 360 games, but | |
# can be actually used to verify any image at all, I guess. | |
# | |
# Run it with image's file name as the argument: | |
# ./verifyiso ~/path/image.iso |
#import <Cocoa/Cocoa.h> | |
@interface MyTextView : NSView { | |
NSMutableAttributedString *_text; | |
} | |
@end | |