Skip to content

Instantly share code, notes, and snippets.

View brandonhilkert's full-sized avatar

Brandon Hilkert brandonhilkert

View GitHub Profile
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install vim tmux git build-essential openssl-dev libxml2-dev python2.7 python2.7-dev fuse libtool autoconf libusb-1.0-0-dev libfuse-dev
pip install cython
pip3 install cython
mkdir ios && cd ios
git clone https://github.com/libimobiledevice/libplist.git

Signup

  • GET /partners/signup will create the requested user in Bark

This endpoint requires request signing authentication

Required parameters:

  • pk - the primary key of the user in your data store
select '2017-02-19'::date as start, ('2017-02-19'::date + interval '30 days') as future
2017-02-19 2017-03-21 00:00:00
select '2017-02-19'::date as start, ('2017-02-19'::date + interval '1 month') as future
2017-02-19 2017-03-19 00:00:00
@brandonhilkert
brandonhilkert / application_presenter.rb
Created April 21, 2017 14:19
Basic presenters without gem
class ApplicationPresenter
def self.presents(name)
define_method(name) do
@object
end
end
def initialize(object, template = nil)
@object, @template = object, template
end
def connection_link
if likely_private_messages_connection?
["#", { data: { toggle: "modal", target: "#no-activities-modal" } }]
else
h.child_path(connection.child)
end
end
class IncrementConnectionStatWorker
include Sidekiq::Worker
def perform(activity_id)
a = Activity.find(activity_id)
# I had previously used .find_or_initialize_by
# but that proved to not be thread-safe on the incrementing
stat = ConnectionStat.find_by(
day: Time.zone.now.to_date,
<script>
FunnelTools.Funnel.load();
</script>
@brandonhilkert
brandonhilkert / Gemfile
Last active January 12, 2016 23:10 — forked from ntl/Gemfile
source "https://rubygems.org"
gem "whatever"
# Load minitest and red-green
group :minitest do
gem "minitest"
gem "minitest-rg"
end
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
model: function() {
var app = this.modelFor('apps/show');
var adapter = this.container.lookup('adapter:application');
var url = adapter.buildURL('app', app.get('id')) + '/metrics';
adapter.ajax(url, 'GET').then(function(response) {
debugger
class Subscription
def initialize(stripe_id)
@stripe_id = stripe_id
end
def name
subscription.plan.name
end
def amount