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 JNWThrottledBlock : NSObject | |
// Runs the block after the buffer time _only_ if another call with the same identifier is not received | |
// within the buffer time. If a new call is received within that time period the buffer will be reset. | |
// The block will be run on the main queue. | |
// | |
// Identifier and block must not be nil. | |
+ (void)runBlock:(void (^)())block withIdentifier:(NSString *)identifier throttle:(CFTimeInterval)bufferTime; |
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/python | |
from AppKit import NSWorkspace | |
def closeRunningApplication(bundle_id): | |
ws = NSWorkspace.sharedWorkspace() | |
runningApps = ws.runningApplications() | |
for i in runningApps: | |
if i.bundleIdentifier() == bundle_id: | |
i.terminate() |
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/swift | |
import AppKit | |
let application = NSApplication.shared | |
let fileOpenPanel = NSOpenPanel(), fileSavePanel = NSSavePanel() | |
let window: NSWindow = { window in | |
window.setContentSize(NSSize(width:800, height:600)) | |
window.styleMask = [.titled, .closable, .miniaturizable] |
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 Keycode { | |
// Layout-independent Keys | |
// eg.These key codes are always the same key on all layouts. | |
static let returnKey : UInt16 = 0x24 | |
static let enter : UInt16 = 0x4C | |
static let tab : UInt16 = 0x30 | |
static let space : UInt16 = 0x31 | |
static let delete : UInt16 = 0x33 | |
static let escape : UInt16 = 0x35 |
Downloads all wallpapers from https://g.co/ev and annotates them with nice and clean link (like g.co/ev/1207
)
imageIds.json were taken from imageIds.js from Google Chrome Extension
json_to_img.py takes path to imageIds.json as first argument and downloads all images in it
annotate.sh annotates $1
also see launcher.sh for example
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
#! /bin/bash | |
### | |
### svg2icns.bash | |
### Create ICNS file from SVG | |
### | |
### See also: | |
### <https://stackoverflow.com/questions/12306223/how-to-manually-create-icns-files-using-iconutil#39678276> | |
### <https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html> | |
### |
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
/* Shadow 0dp */ | |
box-shadow: none; | |
/* Shadow 1dp */ | |
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20); | |
/* Shadow 2dp */ | |
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20); | |
/* Shadow 3dp */ |
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
#!/bin/bash | |
# args: browser | |
# example: ./getOpenTabs.sh "Brave Browser" | |
# credits: | |
# https://gist.github.com/samyk/65c12468686707b388ec43710430a421 | |
# TODO: | |
# validate args | |
# don't open app if not already open |
OlderNewer