Skip to content

Instantly share code, notes, and snippets.

// 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
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):
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
# 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
@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);
});
/*
loop-sample.cpp
*/
#include <iostream>
using namespace std;
/*
# Build with the following command
@cshtdd
cshtdd / amazon-affiliate-bookmark
Created April 22, 2015 02:52
bookmark to generate amazon affiliate links
javascript:
var affiliateId = "YOUR_AFFILIATE_ID";
var l = window.location.href;
var urlPieces = l.split("/");
var productId = getProductId("dp");
if (!productId){
productId = getProductId("product");
}
@cshtdd
cshtdd / scala-unstable-identifiers.scala
Last active August 11, 2016 11:40
scala-unstable-identifiers
//paste the contents of this file on a scala console and inspect the results
abstract class Token
case class TNum(n: Double) extends Token
case class TOpenP() extends Token
case class TCloseP() extends Token
case class TSum() extends Token
case class TDiff() extends Token
case class TMult() extends Token
case class TDiv() extends Token

Keybase proof

I hereby claim:

  • I am camilin87 on github.
  • I am camilin87 (https://keybase.io/camilin87) on keybase.
  • I have a public key ASA2JSY3LscaDn6Gr37cqH1qa4D_ZRzo0ecfvcDwZAk1YAo

To claim this, I am signing this object:

#!/bin/bash
echo "Start Export Process"
echo "Log into Keybase..."
keybase login
echo "Exporting your PGP keys..."
keybase pgp export -o keybase.public.key
keybase pgp export -s -o keybase.private.key