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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
</head> | |
<body> | |
<input type="text" id="urlInput" placeholder="Enter URL and press Enter" style="width: 300px; padding: 5px;"> | |
<script> | |
const urlInput = document.getElementById('urlInput'); |
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
// NOTE: Nil values implicitly or explicitly passed as arguments to padding() are ignored. | |
// This differs from the built-in SwiftUI version: | |
// | |
// view.padding(trailing: nil) // has no effect | |
// view.padding(.trailing, nil) // resets to default | |
// | |
// See below for a version that matches the built-in behavior. | |
extension View { | |
func padding(horizontal: CGFloat? = nil, vertical: CGFloat? = nil, |
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 | |
import Security | |
extension Bundle { | |
/// Returns whether the bundle was signed for TestFlight beta distribution by checking | |
/// the existence of a specific extension (marker OID) on the code signing certificate. | |
/// | |
/// This routine is inspired by the source code from ProcInfo, the underlying library | |
/// of the WhatsYourSign code signature checking tool developed by Objective-See. Initially, |
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 SwiftUI | |
// MARK: - macOS | |
#if os(macOS) | |
typealias OSColor = NSColor | |
extension OSColor { | |
func resolvedOSColor(colorScheme: ColorScheme? = nil) -> OSColor { |
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
// MIT License | |
// | |
// Copyright (c) 2019 Rostyslav Dovhaliuk | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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 | |
extension Data { | |
public init?(hexString: String) { | |
let utf16 = hexString.utf16 | |
var data = Data(capacity: utf16.count / 2) | |
var hiIndex = utf16.startIndex | |
while hiIndex != utf16.endIndex { | |
guard let hi = Data.decodeNibble(utf16[hiIndex]), |
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
require "date" | |
require "nokogiri" | |
require "open-uri" | |
builder = Nokogiri::XML::Builder.new do |xml| | |
xml.feed ({"xml:lang"=>"en-US", "xmlns"=>"http://www.w3.org/2005/Atom"}) { | |
xml.id "http://camazotz.com/wwdc.xml" | |
xml.link ({"rel"=>"self", "href"=>"http://camazotz.com/wwdc/index.xml"}) | |
xml.link ({"rel"=>"alternate", "type"=>"text/html", "href"=>"https://developer.apple.com/videos/wwdc/"}) | |
xml.title "WWDC Videos" |
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 | |
# vim: set syntax=ruby | |
flag = false | |
files = `git diff --cached --name-only --diff-filter=ACM | grep "_spec\.rb$"`.split("\n") | |
files.each do |file| | |
results = `git diff --cached #{file} | grep "^\+[^+]" | grep ":focus => true"`.split("\n").map { |r| r.sub(/^\+[\s\t]*/, '') } | |
if $? == 0 |
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
/* | |
File: KeychainItemWrapper.h | |
Abstract: | |
Objective-C wrapper for accessing a single keychain item. | |
Version: 1.2 - ARCified | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple | |
Inc. ("Apple") in consideration of your agreement to the following | |
terms, and your use, installation, modification or redistribution of |
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
class BlockAlert | |
def initWithTitle(title, message:message) | |
@alert = UIAlertView.alloc.initWithTitle(title, message:message, delegate:self, cancelButtonTitle:nil, otherButtonTitles:nil) | |
@blocks = [] | |
self | |
end | |
def show | |
@alert.show() |
NewerOlder