Skip to content

Instantly share code, notes, and snippets.

View rob-smallshire's full-sized avatar

Robert Smallshire rob-smallshire

View GitHub Profile
@gobinathm
gobinathm / bitbucket-pipelines.yml
Created April 29, 2021 00:21 — forked from shaypal5/bitbucket-pipelines.yml
Bitbucket status badges
image: python:3.8.3
# pipeline stages definitions
test: &test
step:
name: test
caches:
- pip
script:
- python --version
plugins {
id "org.jetbrains.intellij" version "0.2.15"
id "maven"
id "de.undercouch.download" version "3.2.0"
}
task setupPycharm() {
if (!new File('.gradle/ide').exists()){
download {
src 'https://download.jetbrains.com/python/pycharm-professional-2017.2.tar.gz'
dest '.gradle/downloads/py.tar.gz'
@abingham
abingham / all_pdfs_to_png.sh
Last active March 4, 2016 09:25
Recipes for working with Leanpub
for i in *.pdf; do basename="${i%.*}"; sips -s format png -s dpiWidth 300 -s dpiHeight 300 --resampleWidth 1500 ${basename}.pdf --out ${basename}.png; done
//
// main.swift
// Chapter2
//
// Created by Erica Sadun on 7/2/15.
// Copyright © 2015 Erica Sadun. All rights reserved.
//
import Foundation
@JadenGeller
JadenGeller / Semaphore.swift
Last active May 16, 2017 15:51
Swift Semaphore
struct Semaphore {
let semaphore: dispatch_semaphore_t
init(value: Int = 0) {
semaphore = dispatch_semaphore_create(value)
}
// Blocks the thread until the semaphore is free and returns true
// or until the timeout passes and returns false
import Foundation
extension String
{
var length: Int {
get {
return countElements(self)
}
}