Skip to content

Instantly share code, notes, and snippets.

@tobrien
tobrien / Turning Original PNGs into Print and Web Images
Created March 18, 2011 16:54
This is a problem I used to solve with Photoshop macros. Here's the problem to be solved. You have hundreds of screen captures and you want to turn these screen captures into images with a dropshadow that will be included in a book. Add to this the
#!/bin/bash
# Convert Originals to Web Images
for IMAGE in `find ./orig -name "*.png"`
do
DEST_IMAGE=./web/`basename $IMAGE`
if [[ ! -e $DEST_IMAGE || $IMAGE -nt $DEST_IMAGE ]]
then
convert $IMAGE -verbose -compress jpeg \
-quality 80 -bordercolor None -border 10x10 \
### Keybase proof
I hereby claim:
* I am tobrien on github.
* I am tobrien (https://keybase.io/tobrien) on keybase.
* I have a public key ASBB_iaLgD4jI3h2A-ZVaTptCBkrLl7zfpMalEkEH1J7YAo
To claim this, I am signing this object:
@tobrien
tobrien / build.gradle
Created July 10, 2012 12:53
Groovy Script to Automate Staging with Nexus Professional
import groovy.json.JsonSlurper
import groovy.json.JsonBuilder
apply plugin: 'java'
apply plugin: 'maven'
def repo = "http://localhost:8081/nexus/"
task stage_close(type: StagingCloseTask)
task stage_list(type: StagingListTask)
apply plugin: 'eclipse'
apply plugin: 'scala'
repositories {
mavenCentral()
}
dependencies {
compile 'org.scala-lang:scala-library:2.9.1'
}
@tobrien
tobrien / build.gradle
Created April 13, 2013 03:04
A Sample C/C++ Gradle Build referenced from
apply plugin: "cpp-exe"
executables {
main {
spec {
args "-fno-access-control", "-fconserve-space"
}
}
}
@tobrien
tobrien / build.gradle
Last active December 16, 2015 04:19
A Sample Android Gradle Build referenced from this blog entry: http://www.gradleware.com/news/blog/fighting-common-misconception-gradle-isnt-imperative
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.3'
}
}
apply plugin: 'android'
├── html
│   ├── contactadministrator.vm
│   ├── filtersubscription.vm
│   ├── includes
│   │   ├── emailconstants.vm
│   │   ├── fields
│   │   │   ├── affectsversions.vm
│   │   │   ├── assignee.vm
│   │   │   ├── attachments.vm
│   │   │   ├── changelog.vm
@tobrien
tobrien / build.gradle
Created April 12, 2013 21:33
This is a simple Scala build in Gradle. This particular build file ships with the Gradle distribution and it shows how declarative Gradle can be.
apply plugin: 'eclipse'
apply plugin: 'scala'
repositories {
mavenCentral()
}
dependencies {
compile 'org.scala-lang:scala-library:2.9.1'
}
ivy {
url "http://maven.java.net/content/groups/promoted/"
}
@tobrien
tobrien / query.py
Created October 26, 2012 14:40
Executing a SQLAlchemy Query against Akiban's Nested Resultsets
from sqlalchemy_akiban import nested
stmt = nested([order.c.ordernum, order.c.timestamp]).\
where(order.c.customer_id == customer.c.id)
stmt = select([customer.c.name, stmt.label('orders')])
for customer_row in connection.execute(stmt):
print "customer name:", customer_row['name']
for order_row in customer_row['orders']:
print "ordernum:", order_row['ordernum']