Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
| <?xml version="1.0"?> | |
| <root> | |
| <item> | |
| <name>Switch layout while holding CapsLock</name> | |
| <appendix>F12 is implied to be configured as layout switch key</appendix> | |
| <identifier>temp.switch.layout.by.capslock</identifier> | |
| <autogen>__KeyToKey__ KeyCode::F19, KeyCode::VK_NONE, Option::KEYTOKEY_BEFORE_KEYDOWN, KeyCode::F12, Option::KEYTOKEY_AFTER_KEYUP, KeyCode::F12</autogen> | |
| </item> | |
| <item> | |
| <name>Right Alt to switch layout</name> |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Windows.Media; | |
| namespace MediaTools | |
| { |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
| import UIKit | |
| import CoreData | |
| import AVFoundation | |
| class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, VPDAODelegateProtocol, NSFetchedResultsControllerDelegate { | |
| @IBOutlet weak var segmentedControl: UISegmentedControl! | |
| @IBOutlet weak var tableView: UITableView! | |
| lazy var managedObjectContext : NSManagedObjectContext? = { |
| Load up Terminal (Applications > Utilities > Terminal.app) and type the following. | |
| sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist | |
| To turn it back on, just do the opposite: | |
| sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist |
| import java.util.* | |
| import kotlin.Int | |
| import kotlin.Int as ObserverId | |
| class Event<T>() { | |
| private val listeners: MutableMap<Int, (T) -> Unit> = HashMap(); | |
| private var nextListenerId: Int = 0 | |
| fun observe(listener: (T) -> Unit): ObserverId { | |
| synchronized(this.listeners) { |
| /* | |
| typical usage (FYImageStore is a singleton) | |
| [[FYImageStore instance] retrieveFullsizeImageFromPath:path | |
| completion:^(UIImage* image){ | |
| self.imageView.image = image | |
| }]; | |
| */ | |
| #import "FYImageURL.h" //URL-building utilities, omitted from this Gist. |
| class KeyEventHook private constructor( | |
| private val window: Window, | |
| private val handleKeyEvent: (KeyEvent) -> Boolean, | |
| private var originalCallback: Window.Callback) | |
| : Window.Callback by originalCallback | |
| { | |
| override fun dispatchKeyEvent(event: KeyEvent): Boolean { | |
| if (handleKeyEvent(event)) | |
| return true | |
| return originalCallback.dispatchKeyEvent(event) |
| @file:Suppress("UNUSED_PARAMETER", "NOTHING_TO_INLINE") // it's a stub for ConnectionInspector so just suppress the warnings | |
| import java.io.IOException | |
| import java.io.InputStream | |
| import java.net.HttpURLConnection | |
| class ConnectionInspector(friendlyName: String?) { | |
| inline fun preConnect(connection: HttpURLConnection, requestEntity: ByteArray?) = Unit | |
| inline fun postConnect() = Unit | |
| inline fun interpretResponseStream(responseStream: InputStream?): InputStream? = responseStream |
| diff --git a/kittinunf/fuel/core/requests/DownloadTaskRequest.kt b/kittinunf/fuel/core/requests/DownloadTaskRequest.kt | |
| index d64d331..adfab9b 100755 | |
| --- a/kittinunf/fuel/core/requests/DownloadTaskRequest.kt | |
| +++ b/kittinunf/fuel/core/requests/DownloadTaskRequest.kt | |
| @@ -11,8 +11,8 @@ import java.net.URL | |
| class DownloadTaskRequest(request: Request) : TaskRequest(request) { | |
| - val BUFFER_SIZE = 1024 | |
| - | |
| - var progressCallback: ((Long, Long) -> Unit)? = null | |
| - lateinit var destinationCallback: ((Response, URL) -> File) |