This file contains hidden or 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
// ==UserScript== | |
// @name WorkflowyPlus with Rollovers | |
// @namespace http://confusionstudios.com | |
// @version 0.2 | |
// @author DR2050 | |
// @match https://workflowy.com/* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js | |
// @require https://code.jquery.com/ui/1.12.0/jquery-ui.js | |
// @require https://mididesigner.com/lightbox/jquery.colorbox.js | |
// @grant none |
This file contains hidden or 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 | |
if __FILE__ == $0 | |
bundle_name = ARGV[0] if (ARGV[0]) | |
bundle_name = `pwd`.split('/').last.chomp if bundle_name.nil? | |
bundle_name += ".git.bundle" | |
puts "Backing up to bundle #{bundle_name} in ~/Dropbox/backup/git-repos" | |
homeDir = ENV['HOME'] #cannot use ~ | |
`git bundle create '#{homeDir}/Dropbox/backup/git-repos/#{bundle_name}' --all` | |
end |
This file contains hidden or 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
// DRTimer.swift | |
// ConfusionUtilFramework | |
// | |
// Created by dan on 5/4/17. | |
// Copyright © 2017 Confusion Studios LLC. All rights reserved. | |
// | |
import UIKit | |
// a faster timer than NSTimer, drop in replacement for | |
// just one of the methods... it's not precise but it works... |
This file contains hidden or 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 PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
// CHANGE THIS TO TRUE FOR the lock queue to be used | |
let useLocks = false | |
var counter : Int = 0 |
This file contains hidden or 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
// BinarySearchTests.swift | |
// BinarySearchTests | |
// | |
// Created by Dan Rosenstark on 3/27/17. | |
// Copyright © 2017 Confusion Studios LLC. All rights reserved. | |
import XCTest | |
@testable import SwiftAlgos | |
class BinarySearchTests: XCTestCase { | |
This file contains hidden or 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
//: [Previous](@previous) | |
// http://stackoverflow.com/questions/33696489/overriding-ns-methods-in-swift | |
import UIKit | |
var str = "Hello, playground" | |
//: [Next](@next) | |
extension NSObject { | |
func NSLocalizedString(key: String, comment: String) -> String { | |
return "yes we have localized an NSObject" |
This file contains hidden or 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
// MergeOverlappingIntervals in Swift 3.1 | |
// Created by Dan Rosenstark on 4/1/17. | |
// Copyright © 2017 Confusion Studios LLC. All rights reserved. | |
import XCTest | |
extension CountableClosedRange { | |
// returns the more inclusive range or nil if there's no union | |
func union(with range: CountableClosedRange) -> CountableClosedRange? { | |
if overlaps(range) { |
This file contains hidden or 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 UIKit | |
// Copyright 2017 Dan Rosenstark dr2050.com | |
// See http://stackoverflow.com/a/28570282/8047, too | |
class GameLoop : NSObject { | |
var doSomething: () -> ()! | |
var displayLink : CADisplayLink! | |
init(doSomething: @escaping () -> ()) { |
This file contains hidden or 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
// FastTimer.swift | |
// ConfusionUtilFramework | |
// | |
// Created by Dan Rosenstark on 5/4/17. | |
// Copyright © 2017 Confusion Studios LLC. All rights reserved. | |
import UIKit | |
// a faster timer than NSTimer, drop in replacement for | |
// just one of the methods... it's not precise but it works... | |
@objc(FastTimer) |
This file contains hidden or 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 | |
#git-branch-pick by Dan Rosenstark | |
require 'io/console' | |
# can take a command, default is checkout | |
command = ARGV[0] | |
updateSubmodules = false | |
if !command | |
command = "checkout" | |
puts "Using git #{command}.\nYou can choose a different command, e.g., git branch-pick \"branch -D\"" |