Skip to content

Instantly share code, notes, and snippets.

history | awk '{print $2}' | sort | uniq -c | sort -nr | head -25
if [ -d ~/folder ]; then
echo "Folder exists"
fi
# will match if it has notes or twitter in them
^(?=.*(?:notes|twitter)).*
# will match all that don't have notes or twitter'
^(?!.*(?:notes|twitter)).*
if [ -f ~/file.txt ]; then
echo "File exists"
fi
class Borg(object):
"""
Impementation of the Borg-Pattern.
Source: http://code.activestate.com/recipes/66531/
"""
__we_are_one = {}
def __init__(self):
self.__dict__ = self. __we_are_one
(*
Written by hypert.
Based on Sean Long's "Copy Safari Tabs" (http://www.macosxhints.com/article.php?story=20060129175300877),
Mark Hunte's "Save Safari Tabs" (http://www.macosxhints.com/article.php?story=20051121170745971),
and Adam Brin's "Safari Tabs" (http://www.macosxhints.com/article.php?story=20040917211924222).
*)
property NEW_FOLDER_KEY : "n"
# Python 2
import datetime
def getFiletime(dt):
microseconds = int(dt, 16) / 10
seconds, microseconds = divmod(microseconds, 1000000)
days, seconds = divmod(seconds, 86400)
return datetime.datetime(1601, 1, 1) + datetime.timedelta(days, seconds, microseconds)
// Set the window standard button properties
// Hidde the window close button
self.window?.standardWindowButton(NSWindowButton.closeButton)?.isHidden = true
// Hidde the windwo miniaturize button
self.window?.standardWindowButton(NSWindowButton.miniaturizeButton)?.isHidden = true
// Hidde the window zoom button
self.window?.standardWindowButton(NSWindowButton.zoomButton)?.isHidden = true
// Set the window title properties
// Set the window movable by clicking and dragging
self.window?.isMovableByWindowBackground = true
// Set the window titlebar transparent
self.window?.titlebarAppearsTransparent = true
// Set the window title
self.window?.title = ""