Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>etherpad</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/etherpad/trunk/etherpad/bin/run-local.sh</string>
</array>
#!/bin/bash -e
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
/*
* fguillen: 2009-07-09
* return the last word from cursor on a textarea
* example: alert( "last word from cursor: " + $('#my_textarea').lastWord() )
* fixed bug which caused runaway loop when pattern doesn't recognise the start of the textarea (bigfudge)
*/
jQuery.fn.lastWord = function() {
var buffer = '';
this.each(function(){
SELECT dbo.tblResearchDyads.ResearchID, dbo.tblResearchDyads.TherID, dbo.tblResearchDyads.InTX1, dbo.tblResearchDyads.OutTX1,
dbo.tblResearchDyads.dyadid, dbo.tblResearchClients.Condition, dbo.tblResearchDyads.Experience, dbo.tblResearchDyads.clinicalexperience,
dbo.tblResearchDyads.degree, dbo.tblResearchDyads.degreeyears, dbo.tblResearchDyads.endreason, dbo.tblResearchDyads.supervisorid,
dbo.tblResearchDyads.Training
FROM dbo.tblResearchDyads INNER JOIN
dbo.tblResearchClients ON dbo.tblResearchDyads.ResearchID = dbo.tblResearchClients.ResearchID
WHERE (dbo.tblResearchClients.AIN < 3) AND (dbo.tblResearchClients.Study = 16)
therid clinicalexperience degree degreeyears condition
716200937 2 1 .5 1
716225399 2 3 12
716238066 1 1 15 1
716278684 1
716316442 2 1 1
716336521 2 4 1
716435239 1.75 1 6 1
716565106 1 3 12
716576706 2 1 0 1
from __future__ import division
import itertools
from scipy import stats
import numpy as np
from collections import Counter
# Define some functions to use later
def form_lineup(delta, foils, felons):
Navigating stata help files
from django.contrib import admin
class LinkedInline(admin.options.InlineModelAdmin):
template = "admin/edit_inline/tabular.html"
admin_model_path = None
def __init__(self, *args):
super(LinkedInline, self).__init__(*args)
self.show_url = True
@puterleat
puterleat / markdown_extensions.py
Created September 7, 2012 08:34
citation preprocessor
import markdown
import re
from publications import models
MIXED_CITATION_RE = re.compile(r'\[@([;-@\w\s;]+)\]')
class CitationExtension(markdown.Extension):
""" Citation Extension for Python-Markdown. """
@puterleat
puterleat / gist:4953529
Created February 14, 2013 15:26
sublime text 2 plugin to run selection in Stata
import subprocess
import os
import sublime
import sublime_plugin
class RunInStataCommand(sublime_plugin.TextCommand):
def run(self, edit):
CURR, _ = os.path.split(self.view.file_name())
sel = self.view.sel()