This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MailgunSender | |
// Copyright 2017 Joe Noon <[email protected]> | |
// MIT License | |
// | |
// This is a simple wrapper around mailgun.send that adds easy templating and forces | |
// tags to be used. | |
// | |
// Initialize a MailgunSender with the path to your templates, and instance of mailgun: | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates classes in Obj-C and Java that contain values from | |
# config.yaml (which can be overridden by ENV). | |
# Values are obfuscated. (Untested as to how secure this is, | |
# but the point is to do better than completely plain | |
# public api keys visible in builds/plists) | |
# The key value pairs can be accessed from React Native via: | |
# NativeModules.AppEnv.XYZ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# CLI wrapper to simplify outputting a doc or all docs from a cblite db. | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015, Joe Noon | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if defined?(PhusionPassenger) | |
# Rails.logger is not available at the time of adding the middleware | |
class PassengerRailsLoggerProxy | |
def info(*args) | |
if @logger ||= Rails.logger | |
@logger.info(*args) | |
end | |
end | |
end | |
PhusionPassenger.require_passenger_lib 'rack/out_of_band_gc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2013 Joe Noon (https://github.com/joenoon) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [ UIViewController, UIView, etc. ]... | |
[ UIViewController ].each do |klass| | |
klass.class_eval do | |
def self.allocWithZone(zone) | |
super.tap do |x| | |
p " + alloc! #{x.inspect}" | |
end | |
end | |
alias_method 'old_dealloc', 'dealloc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
DROP TABLE IF EXISTS tmp_series_episodes; | |
-- a temp table containing each episode with its cooresponding series | |
CREATE TEMP TABLE tmp_series_episodes AS | |
SELECT series.id series_id, | |
series.title series_name, | |
series.added_at series_added_at, | |
episode.id episode_id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class YapModel | |
def self.database | |
Dispatch.once { @database = YapDatabase.alloc.initWithPath(App.documents_path + "/yap.db") } | |
@database | |
end | |
def self.dbconnection | |
Thread.current["yap_dbconnection"] ||= WeakRef.new(new_dbconnection) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original http://pkgs.fedoraproject.org/cgit/htmldoc.git/plain/htmldoc-1.8.27-libpng15.patch?h=f18 | |
From upstream 1.8 branch svn r1668 | |
The previous libpng-1.5 conversion patch here caused corrupt PNG output | |
on 64 bit. e.g. http://answerpot.com/showthread.php?3662601-PNG+Rendering+Problems | |
The upstream version (below) works well. | |
Index: htmldoc/image.cxx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read entitlements from the provisioning_profile | |
# you can the set it like this: | |
# app.entitlements = app.read_provisioning_profile_entitlements | |
module Motion | |
module Project | |
class Config | |
def read_provisioning_profile_entitlements | |
text = File.read(provisioning_profile) | |
text.force_encoding('binary') if RUBY_VERSION >= '1.9.0' | |
text = text.scan(/<key>\s*Entitlements\s*<\/key>\s*<dict>(.*?)\s*<\/dict>/m)[0][0] |