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
import UIKit | |
/// A validation rule for text input. | |
public enum TextValidationRule { | |
/// Any input is valid, including an empty string. | |
case noRestriction | |
/// The input must not be empty. | |
case nonEmpty | |
/// The enitre input must match a regular expression. A matching substring is not enough. | |
case regularExpression(NSRegularExpression) |
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
/* | |
var t = Timer() | |
t.start() | |
// do something | |
t.stop() | |
print("took \(t.seconds)") | |
*/ |
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
http://stackoverflow.com/questions/3409985/how-to-create-a-menubar-application-for-mac | |
https://github.com/shpakovski/Popup | |
http://blog.shpakovski.com/2011/07/cocoa-popup-window-in-status-bar.html | |
http://cocoatutorial.grapewave.com/2010/01/creating-a-status-bar-application/ |
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
http://magnus-k-karlsson.blogspot.ca/2010/02/how-to-see-expiration-date-and-other.html | |
openssl pkcs12 -in maka.p12 -info | |
-----BEGIN CERTIFICATE----- | |
The content to copy... | |
-----END CERTIFICATE----- | |
openssl x509 -in <your_file.crt> -inform PEM -text |
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
Hide: | |
sudo chpass -s /usr/bin/false username | |
Show: | |
sudo chpass -s /bin/bash username |
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
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] | |
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install django-toolbelt |
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
GET /session/new gets the webpage that has the login form | |
POST /session authenticates credentials against database | |
DELETE /session destroys session and redirect to / | |
GET /users/new gets the webpage that has the registration form | |
POST /users records the entered information into database as a new /user/xxx | |
GET /users/xxx // gets and renders current user data in a profile view | |
POST /users/xxx // updates new information about user | |
http://stackoverflow.com/questions/7140074/restfully-design-login-or-register-resources |
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
Make a copy of the .xib in the Finder. | |
Open the copied file in a text editor. | |
Change "com.apple.InterfaceBuilder3.CocoaTouch.XIB" to "com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB". | |
Change all instances of "IBCocoaTouchFramework" to "IBIPadFramework". | |
Search for sizes like {480, 320} and edit them. Or just reopen the file in Xcode and use the GUI to resize items as needed. | |
http://stackoverflow.com/questions/5347198/xcode-4-xib-create-ipad-version |
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
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
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
disabled: | |
defaults write com.apple.dashboard mcx-disabled -boolean YES && killall Dock | |
enabled: | |
defaults write com.apple.dashboard mcx-disabled -boolean NO && killall Dock | |
http://apple.stackexchange.com/questions/91722/can-i-disable-dashboard-in-mountain-lion |
NewerOlder