Skip to content

Instantly share code, notes, and snippets.

@api-padawan
api-padawan / sem_test.py
Created April 19, 2013 17:32 — forked from ajdavis/sem_test.py
Python 2.6 with a Python 3.2-style semaphore
import threading
import weakref
import time
import thread_util_copy
nthreads = 1000
sem = thread_util_copy.BoundedSemaphore(5)
local = threading.local()
@api-padawan
api-padawan / DQ-GL_Detail_Custom.sql
Created April 19, 2013 17:31 — forked from jerfowler/DQ-GL_Detail_Custom.sql
GL_Detail_Custom Data source for Document Designer
INSERT INTO [CIS].[dbo].[DocumentQuery] ([Name] ,[SQL] ,[ActiveFlag])
VALUES
('GL_Detail_Custom'
,'SELECT GL.[Code]
,GL.[CodeDescription]
,GL.[DateAdded]
,GL.[DateDropped]
,GL.[Sales] as [Exposure]
,GL.[FlagDropped]
@api-padawan
api-padawan / lipsum_helper.php
Created April 19, 2013 16:51 — forked from Naatan/lipsum_helper.php
Lightweight lipsum generator
<?php
function lipsum($amount = 5, $punct = false)
{
$words = ['lorem', 'ipsum','dolor','sit','amet,','consectetur','adipiscing','elit','praesent',
'iaculis','interdum','congue','cras','ac','dictum','nulla.','quisque','quis','neque',
'nibh','curabitur','consequat','scelerisque','magna,','in','lacinia','nibh',
'scelerisque','eget','in','sed','ante','sit','amet','sem','cursus','mollis',
'quisque','venenatis','velit','nec','felis','varius','eu','auctor','odio',
'scelerisque.','nullam','id','enim','leo','donec','eu','ipsum','non','lectus','dapibus'];