Skip to content

Instantly share code, notes, and snippets.

View warthurton's full-sized avatar

Wayne Arthurton warthurton

View GitHub Profile
@warthurton
warthurton / play_all_voices.sh
Last active August 29, 2015 14:26 — forked from ttscoff/play_all_voices.sh
A quick Bash loop to play all available voices for OS X say command
#!/bin/bash
# Arguments can include a quoted string to define the test string to be repeated
# If an argument is numbers only, it changes the rate at which to speak (words per minute, default 200)
play_all_voices() {
local voice
local rate=200
local test_string="How are you?"
for arg in $@; do
if [[ $arg =~ ^[0-9]+$ ]]; then
javascript:(function(){!function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";e.exports={readLater:!1,appUrl:void 0,quoteSelection:!0,tagKeywords:{javascript:"javascript",js:"javascript",python:"python",functional:"functional",testing:"testing",youtube:"video",vimeo:"video",video:"video",books:"books",book:"books",github:"github",brooklyn:"brooklyn",motorcycles:"motorcycles",motorcycle:"motorcycles"},titleTweaks:{"github.com":".entry-title .js-current-repository"},descriptionTweaks:{"en.wikipedia.org":"#mw-content-text p"},textLengthLimit:2e3}},{}],2:[function(t,e,n){"use strict";var r=t("strip-utm"),
javascript:(function(){var e=false;var r=null;var t=true;var n={javascript:"javascript",js:"javascript",python:"python",ios:"ios",youtube:"video",vimeo:"video",video:"video",books:"book",book:"book",game:"games",games:"games",recipe:"recipe",recipes:"recipe",food:"recipe",ingredients:"recipe",meal:"recipe"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=1e3;var c=function(e){return e.toLowerCase()};var u=function(e){return e?e.textContent.trim().replace(/\s+/g," ").substring(0,a):null};var l=c(document.title);var s=function(e){if(e){return l.indexOf(c(e))!==-1}else{return false}};var f=function(e,r,t){t=t||window;var n=e.length;var o;for(var i=0;i<n;++i){o=r.call(t,e[i]);if(o!==null){return o}}return null};var v=function(){var e=location.href;var r=location.hostname;var t;if(r in o){t=document.querySelector(o[r]);if(t){return u(t)}}var n=document.title;t=document.querySelector("meta[property='og:title']");if(t){n=t.content.trim().replace(/\s+/g,"
javascript:(function(){var e=true;var r=null;var t=true;var n={javascript:"javascript",js:"javascript",python:"python",ios:"ios",youtube:"video",vimeo:"video",video:"video",books:"book",book:"book",game:"games",games:"games",recipe:"recipe",recipes:"recipe",food:"recipe",ingredients:"recipe",meal:"recipe"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=1e3;var c=function(e){return e.toLowerCase()};var u=function(e){return e?e.textContent.trim().replace(/\s+/g," ").substring(0,a):null};var l=c(document.title);var s=function(e){if(e){return l.indexOf(c(e))!==-1}else{return false}};var f=function(e,r,t){t=t||window;var n=e.length;var o;for(var i=0;i<n;++i){o=r.call(t,e[i]);if(o!==null){return o}}return null};var v=function(){var e=location.href;var r=location.hostname;var t;if(r in o){t=document.querySelector(o[r]);if(t){return u(t)}}var n=document.title;t=document.querySelector("meta[property='og:title']");if(t){n=t.content.trim().replace(/\s+/g," "
<a class="bookmarklet" href="javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('https://pinboard.in/add?url='+encodeURIComponent(q)+'&amp;description='+encodeURIComponent(d)+'&amp;title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=700,height=350'));">popup</a>
Update-ExecutionPolicy
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Set-WindowsExplorerOptions -EnableOpenFileExplorerToQuickAccess
Set-WindowsExplorerOptions -DisableShowFrequentFoldersInQuickAccess -DisableShowRecentFilesInQuickAccess
Set-WindowsExplorerOptions -EnableExpandToOpenFolder -DisableShowProtectedOSFiles
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart
Set-StartScreenOptions -DisableSearchEverywhereInAppsView
Set-TaskbarOptions -Size Small -Lock -Combine Full
@warthurton
warthurton / stuff_to_del.bat
Created May 30, 2017 18:20 — forked from Gaspadlo/stuff_to_del.bat
Fastest possible way to delete large number of files/folders for MS Win (thousands to millions of folders)
@echo off
set /p Input=Enter Folder name to delete:
:ConfPromt
set /p Confirm=Are you sure you want to delete "%CD%\%Input%"?(y/n):
IF /I "%Confirm%" == "n" (
Echo Canceling.
pause
EXIT /b
)
IF /I NOT "%Confirm%" == "y" (
@warthurton
warthurton / !README.md
Last active October 23, 2018 15:00 — forked from Beej126/README.md
Scripted Windows 10 "Win+X" Menu (aka "Power User Menu")

Scripted Win+X shortcuts

Using this in tandem with ListShortcuts.csx becomes a simple scripted backup/restore mechanism for porting your favorite WinX shortcuts to other machines, etc.

sample usage:

  • scriptcs ListShortCuts.csx -- "%LOCALAPPDATA%\Microsoft\Windows\WinX\Group3" > FaveLinks.md
  • scriptcs WinXCreate.csx -- FaveLinks.md

handy nuggets:

  • WinX GUI Tool
  • WinX folder: cd %LOCALAPPDATA%\Microsoft\Windows\WinX
@warthurton
warthurton / README.md
Created December 17, 2017 21:47
Windows Weather Wallpaper via NodeJs scraping a prominent web page

NodeJs Based Exercise

  1. scrape a web page
  2. transform the content
  3. render to png
  4. save to desktop wallpaper

Install

  1. save the js and cmd files to a folder...
  2. edit the url on line 32 of the js for your preferred location
  3. put WKHTMLtoImage.exe in same folder (or your global path); note: somehow the setup.exe didn't save files to my program files but simply extracting the bin folder via zip was fine
@warthurton
warthurton / extract.wsh.js
Created April 4, 2018 20:15 — forked from Beej126/AutoUnZip.wsh.js
Windows File Explorer auto extract zips like Mac Finder
function CheckFolderExistsAndCreate(folder) {
if (fso.FolderExists(folder)) {
WScript.Echo("destination folder already exists: " + folder);
WScript.Quit(1);
}
fso.CreateFolder(folder);
}
function isBiggish(items, depth, why) {