Author: Chris Lattner
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
# disable sleep | |
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1 | |
# re-enable sleep | |
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0 |
Extension:
import Foundation
import UIKit
extension UIColor {
convenience init(hexString: String) {
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int = UInt32()
Scanner(string: hex).scanHexInt32(&int)
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
struct MediaItem { | |
var duration: Int? | |
var title: String? | |
var urlString: String? | |
static func parseM3U(contentsOfFile: String) -> [MediaItem]? { | |
var mediaItems = [MediaItem]() | |
contentsOfFile.enumerateLines({ line, stop in | |
if line.hasPrefix("#EXTINF:") { | |
let infoLine = line.stringByReplacingOccurrencesOfString("#EXTINF:", withString: "") |
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
// | |
// main.m | |
// wwcd15sessionlister | |
// | |
// Created by Steven Troughton-Smith on 10/06/2015. | |
// | |
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) { |
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
//sudo cycript -p Skype | |
@import com.saurik.substrate.MS | |
var get = function(name) | |
{ | |
func_ = dlsym(RTLD_DEFAULT, name) | |
func = function() { var types = 'v', args = [], count = arguments.length; for (var i = 0; i != count; ++i) { types += '@'; args.push(arguments[i]); } new Functor(func_, types).apply(null, args); }; | |
return func | |
} | |
NSLog = get("NSLog"); |
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
/** | |
* | |
* Aaron K. Saunders | |
* twitter: @aaronksaunders | |
* last updated may 23, 2014 | |
* | |
* See more Appcelerator Information on Clearly Innovative Blog | |
* | |
* www.clearlyinnovative.com | |
* blog.clearlyinnovative.com |
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
license: gpl-3.0 | |
redirect: https://observablehq.com/@mbostock/u-s-population-by-age-1850-2000 |