by alexander white ©
| server { listen 80; | |
| server_name example.com; | |
| access_log /var/log/example.com/nginx.access.log; | |
| error_log /var/log/example.com/nginx.error.log; | |
| root /var/www/apps/example.com/public; | |
| charset utf-8; | |
| location / { | |
| rewrite ^ https://$host$request_uri? permanent; | |
| } |
| <?php | |
| // Licence: WTFPL ! http://www.wtfpl.net/about/ | |
| $fbAuth = array("facebook_id" => "123456789", "facebook_token" => "<Use charles proxy to do man-in-middle SSL sniffing and extract fb token>"); | |
| // Do the magic. | |
| $tinderToken = tinderCall("auth", "token", $fbAuth); // Authenticate | |
| $authToken = "X-Auth-Token: $tinderToken\r\nAuthorization: Token token=\"$tinderToken\"\r\n"; |
| import UIKit | |
| import Security | |
| class Keychain { | |
| class func save(key: String, data: NSData) -> Bool { | |
| let query = [ | |
| kSecClass as String : kSecClassGenericPassword as String, | |
| kSecAttrAccount as String : key, | |
| kSecValueData as String : data ] |
| // | |
| // GradientGenerator.swift | |
| // WatchSimulator | |
| // | |
| // Created by Ben Morrow on 10/12/14. | |
| // | |
| // The most up-to-date version of this file is hosted at https://gist.github.com/benmorrow/aa3484dd3128875afbc0 | |
| // | |
| import UIKit |
| import UIKit | |
| extension UIViewController { | |
| func setScreeName(name: String) { | |
| self.title = name | |
| self.sendScreenView() | |
| } | |
| [ | |
| { | |
| "symbol": "$", | |
| "name": "US Dollar", | |
| "symbol_native": "$", | |
| "decimal_digits": 2, | |
| "rounding": 0, | |
| "code": "USD", | |
| "name_plural": "US dollars" | |
| }, |
| extension Array { | |
| var powerSet: [[Element]] { | |
| guard !isEmpty else { return [[]] } | |
| return Array(self[1...]).powerSet.flatMap { [$0, [self[0]] + $0] } | |
| } | |
| } | |
| print([1,2,3,4].powerSet) // -> [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3], [4], [1, 4], [2, 4], [1, 2, 4], [3, 4], [1, 3, 4], [2, 3, 4], [1, 2, 3, 4]] |
| import UIKit | |
| import Security | |
| class Keychain { | |
| class func save(key: String, data: NSData) -> Bool { | |
| let query = [ | |
| kSecClass as String : kSecClassGenericPassword as String, | |
| kSecAttrAccount as String : key, | |
| kSecValueData as String : data ] |
I recently relocated for new employment. I've been staying in an extended stay hotel for about 3 weeks now. The hotel I'm staying in gives its guests free Wifi access. However, it requires users to accept terms and conditions on a splash page via browser interface before they can use the network. This makes it difficult to use my Chromecast with the network, as it doesn't have a means of accessing that splash page. While I could call the IT help line, I decided to explore a work-around.
Like many networks, my hotel's network attempts to improve security by using MAC address filtering. Luckily, Mac OS X (10.4 - 10.10) makes it very easy to spoof your network card's MAC address.
Here's how to add a devices like Chromecast, AppleTV, Roku to a wireless network that requires a browser to authenticate and accept terms and conditions.