Skip to content

Instantly share code, notes, and snippets.

@cshtdd
cshtdd / jasmine-before-each-call-order
Created August 5, 2014 19:05
explain the order in which beforeEach gets called in Jasmine and the test variables scope
describe("jasmine class variables", function() {
var foo = 0;
beforeEach(function() {
foo += 1;
});
it("can be assigned in the before each", function() {
expect(foo).toEqual(1);
});
# read http://peterdowns.com/posts/first-time-with-pypi.html
# make sure to have a ~/.pypirc configured with users and passwords
# go to the package folder
# publish package to test pypi
python setup.py register -r pypitest
python setup.py sdist upload -r pypitest
# publish package to live pypi
python setup.py register -r pypi
declare @param varchar(50)
set @param='PNS,PNR,PUG'
declare @value varchar(50)
set @value='PNR'
select 'yes' as [contains] where charindex(',' + @value + ',', ',' + @param + ',', 0) > 0
import signal
class InterruptableRegion(object):
def __init__(self, sig=signal.SIGINT):
self.sig = sig
self.interrupted = False
self.released = False
self.original_handler = None
def __enter__(self):
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTunesArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com