This assumes that sidekiq.service
is located in <rails root>/lib/services/sidekiq.service
This file contains 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
#!/usr/bin/env ruby | |
## | |
# $ clean-url "http://services.pco.dev/songs?arrangement_name=&author=&bpm_max=&bpm_min=&commit=Apply+Filter&filtered_ministry_path=%2F13%2F14%2F18%2F&key_name=&lyrics=&meter=&music_key=&music_key_end=&music_key_end_major=Major&music_key_major=Major&selection_arrangement_field_15=true&selection_song_option_72=true&song_name=&themes=&utf8=%E2%9C%93" | |
# | |
# ****************************************************** | |
# * commit => Apply+Filter * | |
# * filtered_ministry_path => /13/14/18/ * | |
# * music_key_end_major => Major * | |
# * music_key_major => Major * |
This file contains 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 | |
# brew install coreutils | |
find $(pwd) -name '*.log' | xargs gtruncate --size 0 |
This file contains 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
//: Playground - noun: a place where people can play | |
import UIKit | |
class Node<T : Hashable> : CustomStringConvertible { | |
weak var parent: Node? { | |
get { return _parent } | |
} | |
var left: Node? { |
This file contains 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
extension Float { | |
var radians: Float { | |
get { | |
return self * Float(M_PI / 180.0) | |
} | |
} | |
} | |
struct Location { | |
let radius: Float = 3961.0 |
This file contains 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
# In spec/support/presence.rb | |
RSpec.shared_examples 'presence' do |attrs| | |
describe 'presence validations' do | |
attrs.each do |attr| | |
it "checks presence of #{attr}" do | |
target = described_class.name.downcase.to_sym | |
obj = FactoryGirl.build target, attr.to_sym => nil | |
expect(obj.valid?).to eq false | |
expect(obj.errors[attr.to_sym].size).to eq 1 | |
end |
This file contains 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
UIKIT_EXTERN CGFloat SKYDistanceFromPointToPoint(CGPoint, CGPoint); |
This file contains 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
#import <Foundation/Foundation.h> | |
@interface NSDate (Additions) | |
+ (instancetype)dateWithISO8601DateString:(NSString *)date; | |
+ (instancetype)dateWithISO8601DateTimeString:(NSString *)date; | |
@end | |
@interface NSDateFormatter (Additions) |
This file contains 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
# | |
# Used to valide image sizes in an Xcode asset cataloge. | |
# | |
# If a @1x image is 100x100 this will verify the @2x is 200x200 (+/- 4) and the @3x is 300x300 (+/- 4) | |
# | |
# Usage: | |
# ruby size.rb /full/path/to/assets/Images.xcassets | |
# | |
# Output: | |
# image@3x.png |
This file contains 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
int32_t hex = 0x2578CB; | |
[[UIColor alloc] initWithRed:(((hex >> 16) & 0xFF) / 255.0) green:(((hex >> 8) & 0xFF) / 255.0) blue:((hex & 0xFF) / 255.0) alpha:1.0]; |