Skip to content

Instantly share code, notes, and snippets.

View patbonecrusher's full-sized avatar
:octocat:

Patrick Laplante patbonecrusher

:octocat:
View GitHub Profile
#!/bin/bash
# NOTE: this is an OSX launchd wrapper shell script for Tomcat (to be placed in $CATALINA_HOME/bin)
CATALINA_HOME=/Users/username/tomcat
function shutdown() {
date
echo "Shutting down Tomcat"
$CATALINA_HOME/bin/catalina.sh stop
@muxcmux
muxcmux / version.rake
Created February 12, 2012 02:53
Manage your rails app version with this rake task
def valid? version
pattern = /^\d+\.\d+\.\d+(\-(dev|beta|rc\d+))?$/
raise "Tried to set invalid version: #{version}".red unless version =~ pattern
end
def correct_version version
ver, flag = version.split '-'
v = ver.split '.'
(0..2).each do |n|
v[n] = v[n].to_i
@avalez
avalez / login.js
Created November 30, 2013 18:33
Bitbucket OAuth consumer example (nodejs w. passport)
var passport = require('passport'),
BitbucketStrategy = require('passport-bitbucket').Strategy,
request = require('request');
module.exports = function (app) {
var oauth = {
consumer_key: process.env.BB_CONSUMER_KEY,
consumer_secret: process.env.BB_CONSUMER_SECRET
};
@onmyway133
onmyway133 / FTGPopoverController
Last active March 20, 2016 16:44
FTGPopoverController, a popover that works on both iOS 7 and iOS 8
//FTGPopoverController.h
@interface FTGPopoverController : NSObject
- (instancetype)initWithContentVC:(UIViewController *)contentVC contentSize:(CGSize)contentSize;
- (void)presentInVC:(UIViewController *)vc fromButton:(UIButton *)button;
- (void)dismiss;
- (BOOL)isVisible;
@end