This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/usr/bin/env python | |
""" | |
PIP can stand for PIP Installs packages Programmatically, too! | |
(and here's how) | |
Requires: | |
* Python 2.6 or higher (for print-as-a-function) | |
* PIP 0.8.2 | |
""" |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
The segfault problem with posix_spawn is indeed caused by Lion's compiler being LLVM and not GCC by default. However, when I installed RVM, the notes suggested that on Lion you need to add export CC=/usr/bin/gcc-4.2
to your shell startup file (.bashrc
or .zshrc
as appropriate). I did that, but it seems that's what caused problems: while ruby 1.9.2 needs you to use GCC to install it, using the same compiler for the gems apparently causes breakage.
First, you need to install XCode 4.x, which is now a free (though hefty!) download from the Mac App Store. Without that, you have no gcc, so you won't get anywhere ;-)
Next, what you need to do is clear out your rvm ruby and the associated gems (make sure you are cd'd into your octopress repository then do:
rvm remove ruby-1.9.2 --gems --archive
which will clear everything out so that you can start from scratch. Obviously, if you have other stuff you've installed for other purposes using RVM, be careful with this. If you previously had the export CC li
Tired of waiting for emacs to start on OS X? This step by step guide will
teach you how to install the latest version of emacs and configure it to start
in the background (daemon mode) and use emacsclient
as your main editor.
Download the latest pretest version of [Emacs for Mac OS X]: http://emacsformacosx.com/builds
This article is now published on my website: Prefer Subshells for Context.
""" | |
This utility addresses the InegrityError that occurs when you try to add a new record to | |
(probably a recently ported) postgres database while using Django, here's more . . . | |
duplicate key value violates unique constraint "<app>_<table>_pkey" | |
DETAIL: Key (id)=(2) already exists. | |
The problem here is that the Postgres sequence generators are out of sync with your data. | |
Here's a good overview: http://www.vlent.nl/weblog/2011/05/06/integrityerror-duplicate-key-value-violates-unique-constraint/ |
import win32serviceutil | |
import win32service | |
import win32event | |
import servicemanager | |
import socket | |
import time | |
import logging | |
logging.basicConfig( | |
filename = 'c:\\Temp\\hello-service.log', |
class DisableMigrations(object): | |
def __contains__(self, item): | |
return True | |
def __getitem__(self, item): | |
return "notmigrations" | |
MIGRATION_MODULES = DisableMigrations() |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
var ui = SpreadsheetApp.getUi(); | |
function onOpen(e){ | |
ui.createMenu("Gmail Manager").addItem("Get Emails by Label", "getGmailEmails").addToUi(); | |
} | |
function getGmailEmails(){ | |
var input = ui.prompt('Label Name', 'Enter the label name that is assigned to your emails:', Browser.Buttons.OK_CANCEL); | |