Skip to content

Instantly share code, notes, and snippets.

View dpritchett's full-sized avatar
🦅
microservice party

Daniel Pritchett ⚡ dpritchett

🦅
microservice party
View GitHub Profile
@dpritchett
dpritchett / naur.md
Last active January 10, 2023 18:58
Programming as Theory Building

Programming as Theory Building

Peter Naur, 1985

(copied from http://alistair.cockburn.us/ASD+book+extract%3A+%22Naur,+Ehn,+Musashi%22)

Introduction

The present discussion is a contribution to the understanding of what programming is. It suggests that programming properly should be regarded as an activity by which the programmers form or achieve a certain kind of insight, a theory, of the matters at hand. This suggestion is in contrast to what appears to be a more common notion, that programming should be regarded as a production of a program and certain other texts.

@prakhar1989
prakhar1989 / richhickey.md
Last active November 8, 2023 17:19 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@tlowrimore
tlowrimore / assets_gz.conf
Last active December 14, 2015 23:59
Apache config directives for serving Rails's precompiled .gz files, created by the asset pipeline during precompile.
<LocationMatch "^/assets/.*$">
Header unset ETag
FileETag None
# RFC says only cache for 1 year
ExpiresActive On
ExpiresDefault "access plus 1 year"
RewriteEngine On
RewriteCond %{HTTP:Accept-Encoding} gzip
@bradmontgomery
bradmontgomery / manage_fabric.py
Created October 31, 2011 02:33
A stab at running remote Django management commands via fabric.
def manage(management_command, args=None):
with cd(REMOTE_PROJECT_DIR):
cmd = "source /path/to/virtualenv/bin/activate && "
cmd += "python manage.py %s %s" % (management_command, args or '')
run(cmd)
@dpritchett
dpritchett / sms_myself.py
Created July 24, 2011 18:54
Sending a text message via Twilio using Python or Ruby
#!/usr/bin/env python
"""
REQUIREMENTS:
* A Twilio account
* Python with the twilio library (`pip install twilio`)
* A purchased phone number on twilio to serve as your "from" number ($1/mo)
* Some twilio credits to pay for the $.01/msg SMS fees
The python-twilio library uses OS-level environment variables
@Janiczek
Janiczek / ProjectEuler.coffee
Created May 31, 2011 21:57
First few Project Euler problems solved in CoffeeScript. Comments on how to make it more beautiful (in terms of CoffeeScript, not algorithm) highly appreciated!
@_1 = ->
# sum of multiples of 3 or 5 (not both) under 1K
answer = 0
for n in [1...1000]
if n % 3 == 0 or n % 5 == 0
answer += n
@bradmontgomery
bradmontgomery / paper.py
Created May 9, 2011 14:19
Short python script to show that if you could fold a piece of paper in half 50 times, its thickness will be 3/4 the distance from the Earth to the Sun (71 million miles). Discovered on a very interesting Quora question.
"""
Folding paper in half 50 times is 3/4 of the distance from earth to sun
From:
http://www.quora.com/What-are-some-of-the-most-mind-blowing-facts#answer_526501
Thickness of a sheet of paper: 0.1 mm (~0.004 inches)
"""
@dpritchett
dpritchett / search_fatwallet.py
Created November 17, 2010 22:07
Use this as a cron job maybe?
import feedparser, re #feedparser available at http://feedparser.org/
def search_fatwallet(keyword):
fw = feedparser.parse(r'http://feeds.feedburner.com/FatwalletHotDeals')
for entry in fw.entries:
if re.search(keyword, entry['title']):
print entry['title'], '\n', entry['feedburner_origlink']
print ''
"""
>>> search_fatwallet('car')
@nruth
nruth / tests_spec.rb
Created July 30, 2010 20:48
how not to loop/nest rspec example groups (where you want to iterate diferent let/before variable values)
class Tests
SUBTESTS = %w(Abstract Decision Quantitative Verbal)
end
describe Tests do
describe "before assigning @ - " do
describe "this doesn't work because the loops are all at the same describe level (the befores override one another)" do
Tests::SUBTESTS.each do |test|
before(:each) do