Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
if (typeof exports === 'undefined') exports = {} | |
function timer (repeats, func, delay) { | |
var args = Array.prototype.slice.call(arguments, 2, -1) | |
args.unshift(this) | |
var boundFunc = func.bind.apply(func, args) | |
var operation = $.NSBlockOperation.blockOperationWithBlock(boundFunc) | |
var timer = $.NSTimer.timerWithTimeIntervalTargetSelectorUserInfoRepeats( | |
delay / 1000, operation, 'main', null, repeats | |
) |
function run() { | |
// KEYBOARD MAESTRO VARIABLES IN YOSEMITE JXA JAVASCRIPT FOR APPLICATIONS | |
// FINDING, CREATING, READING, UPDATING | |
// SIMPLE EXAMPLE - TOGGLING A BOOLEAN KM VARIABLE FROM .js | |
var strKMVarName = "flag"; | |
-- This script includes examples for using AppleScript to perform several | |
-- useful tasks with Evernote. | |
-- Each section illustrates a chunk of Evernote's AppleScript interface, | |
-- and each section also cleans up after itself. | |
-- Please refer to the Evernote application's scripting dictionary for |
(function () { | |
'use strict'; | |
// OSX JavaScript for Applications lacks the persistent 'properties' | |
// of AppleScript (in which global variables and properties persist between script runs) | |
// but we can, of course, serialise to JSON or plist at the end of a script | |
// parsing it at the start of the next run. | |
// Here is one approach to persistence between script runs | |
// using JSON.stringify() and JSON.parse() |
-- allSettings is a list of records containing {width:? height:? apps:{{name:? pos:? size:?},...} | |
-- for each display setup store the apps and their associated position and size | |
property allSettings : {} | |
-- create a variable for the current settings | |
set currentSettings to {} | |
display dialog "Restore or save window settings?" buttons {"Restore", "Save"} default button "Restore" | |
set dialogResult to result |
// YOSEMITE Javascript for Applications JXA | |
// Capture the main result links from a Google search page as Markdown | |
// ( Using XPath to search for <a> elements which are children | |
// of elements with class 'r' | |
var resultLinksMD = function () { | |
var r = document.evaluate( | |
"//*[@class='r']/a", | |
document, null, 0, null | |
), |
// Ver 0.4 Rob Trew | |
// Library for using OSX Yosemite Script Editor scripts | |
// written in an idiom compatible with FoldingText, Drafts, 1Writer, TextWell | |
// In iOS Drafts 4 scripts, the header is simply: | |
// var drafts = this; | |
// For headers for FoldingText and other editors, see: | |
// See: http://support.foldingtext.com/t/writing-scripts-which-run-on-both-foldingtext-and-ios-drafts-4/652/7 | |
// Call functions, after this header, with the prefix: | |
// drafts. |