Skip to content

Instantly share code, notes, and snippets.

Avatar
🦅
microservice party

Daniel Pritchett ⚡ dpritchett

🦅
microservice party
View GitHub Profile
@dpritchett
dpritchett / naur.md
Last active Jan 11, 2022
Programming as Theory Building
View naur.md

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.

View 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 Jun 25, 2021
rage-quit support for bash
View INSTALL.md

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 Dec 14, 2015
Apache config directives for serving Rails's precompiled .gz files, created by the asset pipeline during precompile.
View assets_gz.conf
<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 Oct 31, 2011
A stab at running remote Django management commands via fabric.
View manage_fabric.py
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 Jul 24, 2011
Sending a text message via Twilio using Python or Ruby
View sms_myself.py
#!/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
First few Project Euler problems solved in CoffeeScript. Comments on how to make it more beautiful (in terms of CoffeeScript, not algorithm) highly appreciated!
View ProjectEuler.coffee
@_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
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.
View paper.py
"""
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 Nov 17, 2010
Use this as a cron job maybe?
View search_fatwallet.py
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 Jul 30, 2010
how not to loop/nest rspec example groups (where you want to iterate diferent let/before variable values)
View tests_spec.rb
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