A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| extension String { | |
| func isValidEmail() -> Bool { | |
| guard !self.lowercaseString.hasPrefix("mailto:") else { return false } | |
| guard let emailDetector = try? NSDataDetector(types: NSTextCheckingType.Link.rawValue) else { return false } | |
| let matches = emailDetector.matchesInString(self, options: NSMatchingOptions.Anchored, range: NSRange(location: 0, length: self.characters.count)) | |
| guard matches.count == 1 else { return false } | |
| return matches[0].URL?.scheme == "mailto" | |
| } | |
| } |
| import Foundation | |
| private class Invoker<EventData> { | |
| weak var listener: AnyObject? | |
| let closure: (EventData) -> Bool | |
| init<Listener : AnyObject>(listener: Listener, method: (Listener) -> (EventData) -> Void) { | |
| self.listener = listener | |
| self.closure = { | |
| [weak listener] (data: EventData) in |
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
| <?php | |
| function mime_type($file) { | |
| // there's a bug that doesn't properly detect | |
| // the mime type of css files | |
| // https://bugs.php.net/bug.php?id=53035 | |
| // so the following is used, instead | |
| // src: http://www.freeformatter.com/mime-types-list.html#mime-types-list | |
| <?php | |
| /** | |
| * FTP with Implicit SSL/TLS Class | |
| * | |
| * Simple wrapper for cURL functions to transfer an ASCII file over FTP with implicit SSL/TLS | |
| * | |
| * @category Class | |
| * @author Max Rice / Damith Jayasinghe | |
| * @since 1.0 | |
| */ |
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |
| /* | |
| -------------------------------- | |
| imgur Upload | |
| -------------------------------- | |
| + https://github.com/pinceladasdaweb/imgur-upload | |
| + version 1.1 | |
| + Copyright 2014 Pedro Rogerio | |
| + Licensed under the MIT license | |
| + Documentation: https://github.com/pinceladasdaweb/imgur-upload |
| #!/bin/bash | |
| # Mavericks has a nasty issue regarding ARPs in corporate networks. | |
| # It appears that they have tried to reduce bandwidth utilization by caching | |
| # the results of ARPs. Unfortunately, this causes big problems with corporate | |
| # networks with Virtual IPs or other corporate network redundancy measures. | |
| # There exist other patches for this issue | |
| # (see https://github.com/MacMiniVault/Mac-Scripts/blob/master/unicastarp/unicastarp-README.md) | |
| # but they write a value that will be pulled everytime the machine reboots. Because |
| // | |
| // UIImage+Network.h | |
| // Fireside | |
| // | |
| // Created by Soroush Khanlou on 8/25/12. | |
| // | |
| // | |
| #import <UIKit/UIKit.h> |