Skip to content

Instantly share code, notes, and snippets.

@peterchappell
peterchappell / LogIt.scpt
Last active August 29, 2015 14:26 — forked from sippey/LogIt.scpt
applescript for use with quicksilver to log text with date and timestamp
using terms from application "Quicksilver"
on process text log_text
set theDate to (do shell script "date '+%A %d-%m-%Y'")
set theTime to (do shell script "date '+%H:%M'")
set theText to log_text
if (log_text is equal to "start") then
set theText to "
---
" & theDate & "
@peterchappell
peterchappell / updateQueryStringParam.js
Last active August 29, 2015 14:17 — forked from excalq/gist:2961415
JavaScript method for updating a url silently
// Explicitly save/update a url parameter using HTML5's replaceState().
function updateQueryStringParam (param, value) {
var baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
var urlQueryString = document.location.search;
var newParam = param + '=' + value;
var params = '?' + newParam;
// If the "search" string exists, then build params from it
if (urlQueryString) {
var keyRegex = new RegExp('([\?&])' + param + '[^&]*');