Skip to content

Instantly share code, notes, and snippets.

@nsu
nsu / crashstorage.py
Created July 29, 2015 21:47
Generic postgres crashstorage for Socorro
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from socorro.external.postgresql.crashstorage import PostgreSQLCrashStorage
class GenericPostgreSQLCrashStorage(PostgreSQLCrashStorage):
def _save_processed_transaction(self, connection, processed_crash):
# Don't generate reports or worry about plugins. Just save the processed crash
self._save_processed_crash(connection, processed_crash)

Keybase proof

I hereby claim:

  • I am nsu on github.
  • I am karp (https://keybase.io/karp) on keybase.
  • I have a public key whose fingerprint is 4424 DB5C 033E EFB2 0F41 7E78 BD9C DB92 5584 1617

To claim this, I am signing this object:

Drupal Base Virtual Machine

This page explains how to set up an empty virtualized environment for developing a drupal site.

Prerequisites

  • Virtualbox - Hosts virtual machines for sandboxing development environments
  • Vagrant - Reproducible configuration and management for virtual machines
  • Git - For setting up vagrant machines
au BufRead,BufNewFile *.md setlocal textwidth=80
au BufRead,BufNewFile *.md 2mat ErrorMsg '\%81v.'

Okay, so you're Ian Fleming, and you're starting work on a new chapter of a book.

At the end of the last chapter, 007 saved a pretty lady from a gang of komodo dragons released by an international terrorist organization that was posing as an Javanese drug cartel. Your editor has looked over that chapter, and, after some changes, she's now happy with your work. So you...

$ git checkout dev-chapter17

work happens…

$ git commit -m "remove clothing from female protaganist"

Quotable Setup Instructions

Prerequisites out the butt

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install curl
@nsu
nsu / gist:6a8467dc654f7ed4cb6b
Created June 27, 2014 15:48
Put bacon in textareas
function setText(textarea) {
jQuery.getJSON('//baconipsum.com/api/?callback=?',
{ 'type':'meat-and-filler', 'start-with-lorem':'1', 'sentences':Math.floor((Math.random() * 3) + 1) },
function(baconGoodness)
{
if (baconGoodness && baconGoodness.length > 0)
{
textarea.value = baconGoodness;
}
}
@nsu
nsu / gist:1b04212d682975958193
Created June 27, 2014 14:15
Get referring page in JS
var previous_URL = document.referrer;
input[type=radio],
input[type=radio] + label{
display:none;
}
input[type=radio]:checked,
input[type=radio]:checked + label{
display:block;
}
<div class="region region-secondary-content"><div class="region-inner clearfix"><div id="block-block-29" class="block block-block no-title odd first block-count-4 block-region-secondary-content block-29" ><div class="block-inner clearfix">
<div class="block-content content"><div id="my-progress-page-tally-marks-and-title-wrapper"><div id="my-progress-page-tally-marks-icon"><img alt="My Progress page icon" src="/safefoodfarm2kid/sites/default/themes/Farm2School/images/my_progress75x50.png" style="height:50px; width:75px" /></div><div id="my-progress-page-title">MY PROGRESS</div></div>
</div>
</div></div><section id="block-views-my-progress-checklist-block-17" class="block block-views even last block-count-5 block-region-secondary-content block-my-progress-checklist-block-17" ><div class="block-inner clearfix">
<h2 class="block-title">My Next Step page view</h2>
<div class="block-content content"><div class="view view-my-progress-checklist view-id-my_progress_checklist view-display-id-bl