Skip to content

Instantly share code, notes, and snippets.

View gregnewman's full-sized avatar

Greg Newman gregnewman

View GitHub Profile
@jefftriplett
jefftriplett / justfile-alfred.py
Last active March 19, 2024 17:31
Example Justfile Alfred Extension
"""
2021-2024 - Jeff Triplett
gist: https://gist.github.com/jefftriplett/e7d4eade12e30001065eed2636010772
pip install typer pydantic
Inspired/jumpstarted by: https://github.com/kjaymiller/Bunch_Alfred
"""
@KevinBatdorf
KevinBatdorf / add-alpine-js-to-tailwind-ui.js
Last active May 7, 2024 18:51
Auto copy the Alpine code from Tailwind UI's copy button
// ==UserScript==
// @name Add AlpineJs to Tailwind UI
// @namespace http://tampermonkey.net/
// @version 3.0
// @description Add Alpine JS code to Tailwind Ui copy/paste
// @author https://gist.github.com/KevinBatdorf/8bd5f808fff6a59e100dfa08a7431822
// @match https://tailwindui.com/components/*
// @grant none
// ==/UserScript==
@epicserve
epicserve / steps_taken_to_fix_python_after_installing_osx_10.8.md
Created July 26, 2012 04:29
How to fix your python virtualenvs after installing OS X 10.8 Mountian Lion

Ran the following so virtualenvwrapper worked again:

$ sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
$ sudo pip install virtualenvwrapper

After I tried using django-admin.py runserver in a virtualenv I got the following error.

IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py'

Running the following fixed that error:

@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@geddski
geddski / nesting.js
Created January 14, 2012 05:08
helper function for nesting backbone collections.
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] = nestedCollection.at(i).attributes;
}
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];
@al3xandru
al3xandru / gist:1169583
Created August 24, 2011 23:31
OmniFocus Generalized Bookmarklet
javascript:(function(){
var enc=encodeURIComponent,
w=window,
frames=w.frames,
d=document,
tn=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),
pu=w.location.href,
isGMail=w.location.host.match(/mail\.google\.com/),
tt=pt=d.title,
subjSpans=d.getElementsByClassName("hP"),i,url;
@dokterbob
dokterbob / admin.py
Created February 15, 2011 20:00
InlineAdmin mixin limiting the selection of related items according to criteria which can depend on the current parent object being edited.
class LimitedAdminInlineMixin(object):
"""
InlineAdmin mixin limiting the selection of related items according to
criteria which can depend on the current parent object being edited.
A typical use case would be selecting a subset of related items from
other inlines, ie. images, to have some relation to other inlines.
Use as follows::
@lwe
lwe / brew-services.rb
Created January 5, 2011 13:13
External script for homebrew to simplify starting services via launchctl, out of the box support for any formula which implements #startup_plist.
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>
# My new git commit shortcut, thanks to http://whatthecommit.com/ :-)
alias commit='git commit -m "$(curl -s http://whatthecommit.com/ |grep '<p>' |cut -c 4-)"'