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
// | |
// SSScrollView.h | |
// | |
/* | |
Get a delegate callback when the scroll view scrolls. | |
*/ | |
#import <Cocoa/Cocoa.h> |
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
// | |
// NSObject+BlockObservation.h | |
// Version 1.0 | |
// | |
// Andy Matuschak | |
// [email protected] | |
// Public domain because I love you. Let me know how you use it. | |
// | |
#import <Cocoa/Cocoa.h> |
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
CGAffineTransform CGAffineTransformFromRectToRect(CGRect fromRect, CGRect toRect) | |
{ | |
CGSize scale = CGSizeMake(toRect.size.width / fromRect.size.width, toRect.size.height / fromRect.size.height); | |
CGRect scaledFromRect = CGRectMake(fromRect.origin.x * scale.width, fromRect.origin.y * scale.height, | |
fromRect.size.width * scale.width, fromRect.size.height * scale.height); | |
CGSize translation = CGSizeMake(fromRect.origin.x - scaledFromRect.origin.x, fromRect.origin.y - scaledFromRect.origin.y); | |
return CGAffineTransformMake(scale.width, 0.0, 0.0, scale.height, translation.width, translation.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
# This is Neocities' Rainbows! config file. We are using this in production to run all our web apps. | |
# It works really well for us and has been heavily load tested, so I wanted to share it with the community. | |
# | |
# In my opinion, this is the best way to deploy a ruby web application. Unlike EventMachine based solutions, | |
# it uses real ruby threads, which allows it to take advantage of the internal non-blocking IO pattern | |
# in MRI. | |
# | |
# Contrary to popular belief, MRI doesn't block execution to wait on IO when you are using threads, even | |
# with the GIL. The requests are done concurrently for anything that is based on the IO class. This | |
# includes things like Net::HTTP and even `system commands`. Grep the MRI Ruby source code for |
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
-- Mountain Lion (10.8) fixed this oversight. The DigitalColor Meter now remembers it's settings on exit. | |
-- DigitalColor Meter defaults to displaying color values in decimal and will not remember hexidecimal preferences on close. So this script launches the app and tells it to display values in hex. It is meant to be launched via QuickSilver or a launcher. | |
-- Checks to see if System Preferences > Universal Access > Enable access for assistive devices is checked | |
-- This option is required for "System Events" to use the keystroke and key code commands. | |
-- If it is not checked, your password is required to make the change | |
tell application "System Events" to if not UI elements enabled then | |
set UI elements enabled to true |
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
# Put this in a logrotate file (like /etc/logrotate.d/yourcompany): | |
/var/log/yourcompany/website.log | |
{ | |
daily | |
rotate 7 | |
compress | |
missingok | |
notifempty | |
sharedscripts | |
size 5M |
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
NSBezierPath *roundedRect = [NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:6.0 yRadius:6.0]; | |
[roundedRect fill]; |
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
#!/bin/sh | |
# Create a RAM disk with same perms as mountpoint | |
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions | |
# Usage: sudo ./xcode_ramdisk.sh start | |
USERNAME=$(logname) | |
TMP_DIR="/private/tmp" | |
RUN_DIR="/var/run" | |
SYS_CACHES_DIR="/Library/Caches" |
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
# Terminal Progress Indicators. Four examples are included: percentage, | |
# spinner, progress bar, and combined. This script has been tested on | |
# Mac OS X 10.8 with Ruby 1.8.7, 1.9.1, 1.9.2, and 1.9.3 | |
class Spinner | |
include Enumerable | |
def each | |
loop do | |
yield '|' | |
yield '/' |
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
208.115.113.86 - - [29/Oct/2012:17:11:45 -0700] "GET /Case%20History/new_page_1.htm HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Ezooms/1.0; [email protected])" "dakotalargeanimalclinic.com" | |
218.30.103.53 - - [29/Oct/2012:17:37:02 -0700] "GET /robots.txt HTTP/1.1" 200 54 "-" "Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)" "www.dakotalargeanimalclinic.com" | |
208.115.111.70 - - [29/Oct/2012:17:46:47 -0700] "GET /robots.txt HTTP/1.1" 200 54 "-" "Mozilla/5.0 (compatible; Ezooms/1.0; [email protected])" "dakotalargeanimalclinic.com" | |
74.125.182.28 - - [29/Oct/2012:17:54:04 -0700] "GET /Equine_Nutrition/teeth_check_horse.html HTTP/1.1" 200 4111 "http://www.google.com/search" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko; Google Web Preview) Chrome/22.0.1229 Safari/537.4" "www.dakotalargeanimalclinic.com" | |
70.238.130.51 - - [29/Oct/2012:17:54:04 -0700] "GET /photo_gallery/black_cat_mouth_open.JPG HTTP/1.1" 200 632815 "http://www.google.com/search?num=10&hl=en&sit |
OlderNewer