body {background:white;}
@media (prefers-color-scheme: dark) {
body {background:black; color:white;}
}
see: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
function chromeStorageLocal() { | |
this.storageArea = chrome.storage.local; | |
this.async = true; | |
} | |
chromeStorageLocal.prototype.get = function(key, callback) { | |
this.storageArea.get(key, function(items) { | |
if (chrome.runtime.lastError) { | |
callback(chrome.runtime.lastError); | |
} else { | |
callback(null, items[key]); |
(function(file){ | |
var script=document.createElement('script'); | |
script.type='text/javascript'; | |
script.src=file; | |
document.body.appendChild(script); | |
})("https://rawgit.com/stu43005/49ff25325b357053b8e9/raw/pixiv_gif_encoder.js"); | |
/* | |
網址列(或書籤)用: | |
javascript:(function(file){var script=document.createElement('script');script.type='text/javascript';script.src=file;document.body.appendChild(script)})("https://rawgit.com/stu43005/49ff25325b357053b8e9/raw/pixiv_gif_encoder.js") |
set progress description to "A simple progress indicator" | |
set progress additional description to "Preparing…" | |
set progress total steps to -1 | |
delay 5 | |
set progress total steps to 100 | |
repeat with i from 1 to 100 | |
try | |
set progress additional description to "I am on step " & i |
-- This code comes from https://gist.github.com/oliveratgithub/ | |
-- Open in AppleScript Editor and save as Application | |
-- ------------------------------------------------------------ | |
--this is required to break the filename into pieces (separate name and extension) | |
set text item delimiters to "." | |
tell application "Finder" | |
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list | |
display dialog "New file name:" default answer "" | |
set new_name to text returned of result | |
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file. |
-- duplicateFinderTab.scpt | |
-- Uses a hacky workaroud to duplicate the frontmost Finder tab, | |
-- since Apple hasn't provided great AppleScript support for this. | |
-- Details at: | |
on new_tab() | |
tell application "System Events" to tell application process "Finder" | |
set frontmost to true | |
tell front menu bar to tell menu "File" to tell menu item "New Tab" | |
perform action "AXPress" |
body {background:white;}
@media (prefers-color-scheme: dark) {
body {background:black; color:white;}
}
see: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
var exports = module.exports = {}; | |
/********************************************************** | |
* @author Alex Nelson | |
* @email [email protected] | |
* @date 29 September 2014 | |
**********************************************************/ | |
/** | |
* My todo list... |
function asyncWhile(condition, action, ctx) { | |
var whilst = function(data) { | |
return condition.call(ctx, data) ? | |
Promise.resolve(action.call(ctx, data)).then(whilst) : | |
data; | |
} | |
return whilst(); | |
} |
cd "$(osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)')" && | |
git status --short --branch |
#!/usr/local/bin/node | |
var Table = require('cli-table'); | |
var table = new Table({ | |
chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': '' | |
, 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': '' | |
, 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': '' | |
, 'right': '' , 'right-mid': '' , 'middle': ' ' }, | |
style: { 'padding-left': 0, 'padding-right': 0 } |