Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.
This is the base javascript:
(function (text) {
var node = document.createElement('textarea')
var selection = document.getSelection()
<# Open-OneNoteNotebook | |
Pass in the UNC path of a OneNote notebook folder, then this will add it to the | |
list of opened notebooks in OneNote. | |
Ex: | |
Open-OneNoteNotebook '\\consanto\public\KnowledgeBase\' | |
#> | |
If (-Not (Test-Path function:global:Open-OneNoteNotebook)) { |
#!/usr/bin/python2.7 | |
import requests | |
import sys | |
from urlparse import urlparse | |
#This will return last modified time of given web page url | |
def get_last_modified(url): | |
result = urlparse(url) | |
if True if [result.scheme, result.netloc, result.path] else False: | |
header = requests.head(url).headers |
Automatically deletes old emails that match the specified label.
LABEL_TO_DELETE
: the label that should be have old messages deleted<a class="btn btn-default btn-info bookmarklet" href="javascript:(function(d){var a=d.document,h=function(){},c=a.body||a.getElementsByTagName("body")[0],f=a.documentElement||a.getElementsByTagName("html")[0],k=[c,f,a],l=["webkit","khtml","moz","ms",""],g=["contextmenu","selectstart","select","mousedown","mouseup"],b=d.Selection,e=b&&b.prototype;e&&(e.removeAllRanges=h,b=a.selection)&&(b.clear=h);for(e=k.length;e--;)if(f=k[e]){for(b=g.length;b--;)f["on"+g[b]]=null;if(a=f.style)for(a.cursor="",a.webkitTouchCallout="initial",b=l.length;b--;)a[((c=l[b])?"-"+c+"-":c)+"user-select"]="initial"}(c=d.jQuery||d.Zepto)&&c(d).off(g)})(this);"> | |
Enable Select | |
</a> |
Short Url: http://caseywatts.com/chromeextensionworkshop
Alternate Short Url: http://tinyurl.com/blatant-panda
Other gists & tricks: http://caseywatts.com/gists-and-tricks
# to add a new Git credential to the Credential Manager: | |
cmdkey /generic:LegacyGeneric:target=git:https://github.com /user:username /pass:"mypassword" | |
# to list all credentials: | |
cmdkey /list |
WebPDecodeAndDraw = function (data) { | |
var decoder = new WebPDecoder(); | |
var bitmap = decoder.WebPDecode(data, data.length); | |
if (bitmap) { | |
//Draw Image | |
var output = ctx.createImageData(canvas.width, canvas.height); | |
var biWidth = canvas.width; | |
var outputData = output.data; |
Sub AutoAcceptMeetings(oRequest As MeetingItem) | |
If oRequest.MessageClass <> "IPM.Schedule.Meeting.Request" Then | |
Exit Sub | |
End If | |
Dim oAppt As AppointmentItem | |
Set oAppt = oRequest.GetAssociatedAppointment(True) | |
Dim oResponse |
; ========================================================================================== | |
; == Modal Dialog Automation | |
; == | |
; == Automates away pesky modal dialogs by applying a default response when they pop up | |
; == Helper functions are at the bottom | |
; ========================================================================================== | |
; Defaults to fast no-regex title matching | |
SetTitleMatchMode, 2 |