This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export WORKDIR=$HOME/work | |
# Creates a working tree to check out a branch locally. | |
# This is useful when you have multiple branches on origin, | |
# and want to pull work work with them | |
function worktree() { | |
# We assume we're always under $WORKDIR somewhere. | |
# Go down the tree until we know what project we're in. | |
while [[ "$(dirname "$PWD")" != $WORKDIR ]] ; do | |
find "$PWD"/ -maxdepth 1 "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template_string, request | |
class CustomFlask(Flask): | |
jinja_options = Flask.jinja_options.copy() | |
jinja_options.update(dict( | |
block_start_string='<%', | |
block_end_string='%>', | |
variable_start_string='%%', | |
variable_end_string='%%', | |
comment_start_string='<#', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set path_ to (get path to desktop as string) & "FOLDER NAME HERE" | |
set prefix_ to "PREFIX HERE" | |
tell application "Finder" | |
set dir_ to folder path_ | |
set files_ to items of dir_ whose name of it starts with prefix_ | |
set start_ to (get length of prefix_) + 1 | |
repeat with file_ in files_ | |
set oldname_ to name of file_ | |
set end_ to length of oldname_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "BBEdit" | |
set theScript to selection as text | |
set clippingFileRef to (path to temporary items as string) & "clipping_as_selection" | |
--close access clippingFileRef | |
set fileref to open for access file clippingFileRef with write permission | |
set eof of fileref to 0 -- clear the file | |
write theScript to fileref | |
close access fileref |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "BBEdit" | |
activate | |
set old_name to name of text window 1 | |
set dialog_result to display dialog "" default answer (old_name) ¬ | |
buttons {"Cancel", "Rename"} default button 2 ¬ | |
with icon note ¬ | |
with title "Rename Active Document" | |
if button returned of dialog_result = "Rename" then | |
set new_name to text returned of dialog_result | |
set d to active document of text window 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# BBErrors: Script to display compiler output messages in BBEdit browser window | |
# Copyright Jay Lieske Jr. | |
# 2 May 2016 | |
import sys, re, os | |
import struct | |
from Foundation import NSAppleEventDescriptor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Keybindings to emulate Postbox defaults in MailMate | |
// From: http://www.postbox-inc.com/support/postbox_shortcuts | |
// Created by Ian Beck <http://beckism.com> | |
"f" = "nextMessage:"; | |
"b" = "previousMessage:"; | |
"n" = "nextUnreadMessage:"; | |
"p" = "previousUnreadMessage:"; | |
"T" = "nextUnreadThread:"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bootstrap, from Twitter</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link href="../assets/css/bootstrap.css" rel="stylesheet"> | |
<style type="text/css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
# Copyright 2011 litl, LLC. All Rights Reserved. | |
import httplib | |
import re | |
import urllib | |
import urlparse | |
from flask import Blueprint, request, Response, url_for | |
from werkzeug.datastructures import Headers |
NewerOlder