Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
# spec/support/timezone.rb | |
module TimeZoneHelpers | |
extend ActiveSupport::Concern | |
def self.randomise_timezone! | |
offsets = ActiveSupport::TimeZone.all.group_by(&:formatted_offset) | |
zones = offsets[offsets.keys.sample] # Random offset to better vary the time zone differences | |
Time.zone = zones.sample # Random zone from the offset (can be just 1st, but let's do random) | |
puts "Current rand time zone: #{Time.zone}. Repro: Time.zone = #{Time.zone.name.inspect}" | |
end |
# Changing terminal color in MacOSX when SSHing (so you know at a glance that you're no longer in Kansas) | |
# Adapted from http://www.rngtng.com/2011/01/14/mac-os-x-terminal-visual-indication-for-your-ssh-connection/ | |
# 1. Create a theme in your terminal setting with the name "SSH" and the desired colors, background, etc. | |
# 2. Add this to your .bash_profile (or .bashrc, I always forget the difference ;)) | |
# 3. Optional but useful: in the terminal, go to Settings > Startup and set "New tabs open with" to | |
# "default settings" (otherwise, if you open a new tab from the changed one, you get a local tab with | |
# the SSH colors) | |
function tabc() { | |
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
@implementation UITextView (RSExtras) | |
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) { | |
/*[s length] is assumed to be 0 or 1. s may be nil. | |
Totally not a strict check.*/ | |
if (s == nil || [s length] < 1) | |
return NO; |
source :rubygems | |
gem "rake" | |
gem 'motion-logger' #cocoalumberjack wrapper |
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
#import <objc/runtime.h> | |
#import <objc/message.h> |
class MyController < UIViewController | |
def viewDidLoad | |
@button = UIButton.alloc.init | |
@button.when_tapped do | |
weak_self = WeakRef.new(self) # <--- create a weak reference to self | |
@alert = UIAlertView.alertViewWithTitle "Alert", | |
message: "Message", | |
cancelButtonTitle: "Dismiss", |
# in rails application.rb | |
initializer "postgresql.no_default_string_limit" do | |
ActiveSupport.on_load(:active_record) do | |
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:string].delete(:limit) | |
end | |
end |
Generate the list yourself:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./* | \
sed 's/NS_AVAILABLE_IOS(.*)//g' | \
sed 's/NS_DEPRECATED_IOS(.*)//g' | \
sed 's/API_AVAILABLE(.*)//g' | \
sed 's/API_UNAVAILABLE(.*)//g' | \
sed 's/UI_APPEARANCE_SELECTOR//g' | \