Skip to content

Instantly share code, notes, and snippets.

View johnhamelink's full-sized avatar
🔨
Building

John Hamelink johnhamelink

🔨
Building
View GitHub Profile
def has_ios?
devices.exists?(device_type: :ios)
end
def has_android?
devices.exists?(device_type: :android)
end
class PushNotificationService
IOS_NAME = 'ios'.freeze
ANDROID_NAME = 'android'.freeze
attr_accessor :gcm_notification, :apns_notification,
:ios_app, :android_app
def gcm_notification
@gcm_notification || Rpush::Gcm::Notification
end
SANDBOX_APN_CERT = File.read(Rails.root.join('db', 'fixtures', 'development', 'raw', 'ios_sandbox.pem'))
SANDBOX_GCM_KEY = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
def create_or_update_by_id(klass, id, params)
if config = klass.find(id) rescue nil
config.update_attributes(params)
else
klass.create!(params)
end
end
class S3Service
# TODO: Retrieve Temporary credentials from AWS metadata server (MDS) using the AWS SDK
# TODO: Add the x-amz-security-token to the policy, so that we can verify the temporary credentials. See here:
# - http://docs.aws.amazon.com/AWSSdkDocsRuby/latest/DeveloperGuide/ruby-dg-roles.html
# - http://www.spacevatican.org/2013/7/7/direct-to-s3-browser-uploads/
def initialize(args = {})
fail ArgumentError unless args[:name] && args[:type]
@expires = 5.minutes.from_now.iso8601
@access_key_id = ENV['AWS_ACCESS_KEY_ID']
array(
'postdateofsale' => "`DateOfSale`",
'postfirstname' => "`FirstName`",
'postsurname' => "`Surname`",
'posthousenumber' => "`HouseNumber`",
'postaddressstreetname' => "`AddressStreetName`",
'postpostcode' => "`PostCode`",
'posttelephonenumber' => "`TelephoneNumber`",
'postmobilenumber' => "`MobileNumber`",
'postcontractnumber' => "`ContractNumber`",
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
;; Org Mode:
(setq org-image-actual-width nil)
DateClient NamePayout ValuePaidCoinbase Fee
<2016-08-01 Mon>AAAAAAAAAAAAAAAA1111111111112.3429
<2016-08-01 Mon>AAAAAAAAAAAAAAAA1111111111110.3021
<2016-08-01 Mon>AAAAAAAAAAAAAAAA1111111111110.8438
<2016-08-02 Tue>AAAAAAAAAAAAAAAA1111111111111.0843
<2016-08-03 Wed>AAAAAAAAAAAAAAAA1111111111110.3653
# DO NOT MODIFY THIS FILE, it was auto-generated.
#
# Date: 2015-11-19 19:49:21 +0000
# Seeding Venue
# Written with the command:
#
# ./bin/rake import:venues
#
Venue.seed(:name,
{:name=>"Hampden Park", :description=>"Vast football stadium for national matches, music concerts and other sporting events, with a museum.", :address=>"Glasgow, Glasgow City", :postcode=>"G42 9BA", :cover_photo=>"http://tsg.uk.com/wp-content/uploads/2014/09/Before-2.jpg", :owner_id=>1, :coordinates=>"POINT(-4.248908758 55.82685311)", :bounds=>"POLYGON((55.826117889803356 -4.25646185874939, 55.826256498017074 -4.255861043930054, 55.82611186334809 -4.255796670913696, 55.82619020719386 -4.254755973815918, 55.82619020719386 -4.254755973815918, 55.82619020719386 -4.254755973815918, 55.82619020719386 -4.254755973815918, 55.82629265660028 -4.254863262176514, 55.826286630172085 -4.255110025405884, 55.826419211376866 -4.25520658493042, 55.827045952773325 -4.250335693359375, 55.82716647880727 -4.25020694732666, 55.8272207154007 -4.2499601
{
"firebase": "findaplayer",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"cleanurls": false,
"rewrites" : [
<!DOCTYPE html>
<html>
<head>
<style>/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figur