Skip to content

Instantly share code, notes, and snippets.

@lyndsysimon
lyndsysimon / account_merge.py
Created Apr 22, 2015
OSF fixture generator
View account_merge.py
from tests import factories
from website import models
from website.util import web_url_for
from main import app
def print_merge_url(user, token, prefix):
with app.test_request_context():
print(prefix + ": " +
web_url_for(
'confirm_email_get',
View temp.json
{
"tasks": [
{ "id": 1, "text": "my text 1" },
{ "id": 2, "text": "my text 2" },
{ "id": 3, "text": "my text 3" },
{ "id": 4, "text": "my text 4" }
]
}
@lyndsysimon
lyndsysimon / mantras.md
Last active Aug 29, 2015
Lyndsy's Development Mantras
View mantras.md
  • There once was a developer who had a problem. They decided to solve this problem using a regex. That developer now has two problems.

  • All problems in computer science can be solved through additional layers of abstraction.

@lyndsysimon
lyndsysimon / templating_language_concept
Last active Dec 20, 2015
A quick concept of a pythonic templating language based on Zen Coding, with inspiration from HAML and SASS.
View templating_language_concept
#### Template (proposed, unnamed language)
doctype(5)
html>head
style('my_stylesheet.css')
script('my_script.js')
title= {{ title }}
body>div.container
navbar(main_menu_links)
View gist:5861852

Virtualenv's bin/activate is Doing It Wrong

I'm a Python programmer and frequently work with the excellent [virtualenv][] tool by Ian Bicking.

Virtualenv is a great tool on the whole but there is one glaring problem: the activate script that virtualenv provides as a convenience to enable its functionality requires you to source it with your shell to invoke it. The activate script sets some environment variables in your current environment and defines for you a deactivate shell function which will (attempt to) help you to undo those changes later.

This pattern is abhorrently wrong and un-unix-y. activate should instead do what ssh-agent does, and launch a sub-shell or sub-command with a modified environment.

Problems