Skip to content

Instantly share code, notes, and snippets.

View benilovj's full-sized avatar

Jake Benilov benilovj

View GitHub Profile
// UIImage+Alpha.h
// Created by Trevor Harmon on 9/20/09.
// Free for personal or commercial use, with or without modification.
// No warranty is expressed or implied.
// Helper methods for adding an alpha layer to an image
@interface UIImage (Alpha)
- (BOOL)hasAlpha;
- (UIImage *)imageWithAlpha;
- (UIImage *)transparentBorderImage:(NSUInteger)borderSize;
@benilovj
benilovj / emp_dept_insts.sql
Created April 3, 2013 07:16
Example of Oracle collection types
--
-- Copyright (c) Oracle Corporation 1988, 1999. All Rights Reserved.
--
-- NAME
-- demobld.sql
--
-- DESCRIPTION
-- This script creates the SQL*Plus demonstration tables in the
-- current schema. It should be STARTed by each user wishing to
-- access the tables. To remove the tables use the demodrop.sql
@benilovj
benilovj / update_zendesk_triggers_over_rest.rb
Created May 6, 2013 10:53
This script uses the Zendesk REST API v2 to update triggers.
require 'yaml'
require 'json'
require 'httparty'
class Zendesk
include HTTParty
base_uri "https://zendeskinstance.zendesk.com/api/v2"
headers 'Content-Type' => "application/json"
# debug_output $stderr
require 'zendesk_api'
require 'yaml'
class ZendeskClientBuilder
def self.build
zendesk_config = YAML.load(File.read('../config/zendesk.yml'))["production"]
ZendeskAPI::Client.new { |config|
config.url = "https://govuk.zendesk.com/api/v2/"
config.username = zendesk_config["username"]
@benilovj
benilovj / gist:7804759
Last active December 30, 2015 08:49
proposed service feedback API format
# GET /anonymous_feedback/service_feedback/yesterday
# (last day's data, midnight to midnight)
# GET /anonymous_feedback/service_feedback?from=2013-01-01&to=2013-01-02
[
"from": "2013-01-01T00:00:00+00:00",
"to": "2013-01-02T00:00:00+00:00",
"results": [
@benilovj
benilovj / scan_for_wordpress.rb
Created November 19, 2015 14:39
A ruby script that takes a list of domains and tries to figure out if that site runs WordPress or not.
require 'open-uri'
require 'open_uri_redirections'
require 'timeout'
require 'active_support/core_ext/array'
require 'pp'
def fetch(url)
# puts "Fetching #{url}"
Timeout::timeout(2) {
open(url, allow_redirections: :safe).read rescue nil
@benilovj
benilovj / config.cson
Created January 14, 2016 15:34
My Atom config for ERB templates and Ruby ( http://blog.atom.io/2014/10/31/language-scoped-config.html )
'text.html.ruby':
editor:
showIndentGuide: true
softTabs: false
'.source.ruby': # ruby overrides
editor:
tabLength: 2
mkdir 1pass-for-wordpress
cd 1pass-for-wordpress
git clone git@github.com:1Pass/1pass-for-wordpress.git git
svn co https://plugins.svn.wordpress.org/1pass svn
git clone --recursive git@github.com:kasparsd/wp-deploy.git
cd git
composer install --no-dev
@benilovj
benilovj / levy_balance.feature
Created June 27, 2017 10:53
Feature: levy balance view
Feature: levy balance view
In order to understand trends in levy funds coming in and payments going out
As a senior stakeholder
I can see levy funds and payments rolled up by month and funding source/type of credit
Scenario: levy balances
Given the following employer accounts:
| AccountId | DasAccountId | AccountName |
| 123 | ABC123 | CompanyABC |
And the following PAYE schemes: