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
#!/usr/bin/env ruby | |
require 'diffy' # gem install diffy | |
require 'listen' # gem install listen | |
class String | |
def colorize(color_code) | |
"\e[#{color_code}m#{self}\e[0m" | |
end |
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
h1[role="heading"] { | |
padding-top: 2em; | |
} | |
h1[role="heading"] svg g { | |
opacity: 0; | |
} | |
h1[role="heading"] svg { |
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
#!/usr/bin/env ruby | |
# Prerequisities: | |
# - brew install fswawtch | |
# - gem install diffy | |
# Usage: | |
# cd ~/Library/Preferences; ruby system_settings_differ.rb | |
require 'pp' | |
require 'pty' |
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
@interface UIScrollView () | |
- (BOOL)_isScrubbing; | |
@end | |
@implementation UIScrollView (ScrollbarDraggingDetect) | |
/// A bit complicated and sophisticated subview introspection to detect whether | |
/// the vertical scroll indicator is “expanded for direct manipulation” (= being | |
/// dragged) using private accessors reads and some clang diagnostics pushing. |
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
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wundeclared-selector" | |
+ (void)initialize | |
{ | |
[super initialize]; | |
#if __IPHONE_13_0 | |
// IOS-13-TODO: Work-around for Facebook SDK to force-use Safari auth session | |
// instead of AuthServices session as this requires specific |
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
# Path: .../Colors.xcassets | |
# Usage: ruby exportColours.rb | |
require 'json' | |
def parseHex(inp) | |
return inp[2..-1] if inp.index('0x') == 0 | |
ret = ((inp.to_f) * 255).to_i.to_s(16) | |
ret = '0'+ ret if ret.length == 1 | |
return ret |
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 Foundation | |
#if swift(>=5.0) | |
extension StringProtocol where Index == String.Index { | |
func split(string str: String) -> [Substring] { | |
var si = self.startIndex |
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 <Foundation/Foundation.h> | |
@interface NSString (FoundationMutabilityType) | |
- (NSString *)copy; | |
- (NSMutableString *)mutableCopy; | |
@end | |
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
#!/usr/bin/env ruby | |
# Check for arguments | |
def check_ip_ip_range(inp) | |
return inp =~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\/[0-9]{1,2})?$/ ? true : false | |
end | |
if ARGV.count < 1 then | |
puts "Usage: enforcevpnhost [ip4|ip4net|hostname]" |
NewerOlder