I hereby claim:
- I am zmajstor on github.
- I am zmajstor (https://keybase.io/zmajstor) on keybase.
- I have a public key whose fingerprint is 051D F53E 7747 101E 4A93 6AD8 C8CD 3A5E 8BFD BF3D
To claim this, I am signing this object:
class Collection < ActiveRecord::Base | |
has_many :products | |
scope :live, where("collections.end_date IS NOT NULL AND collections.end_date >= ?", Time.now.to_date) | |
end | |
class Product < ActiveRecord::Base | |
belongs_to :collection | |
# how to DRY this .where ? | |
scope :launched, joins(:collection).where("collections.end_date IS NOT NULL AND collections.end_date >= ?", Time.now.to_date) |
<div class="card"> | |
<%= image_tag (collection.designer.cover_image_url), class: "center-block" %> | |
<div class="card-hover"> | |
<span class="card-overlay"> | |
<%= collection.designer.fullname %><br> | |
<%= collection.designer.live_collection.name %><br> | |
<%= collection.designer.location %> | |
</span> | |
</div> | |
</div> |
# encoding: utf-8 | |
class AviaryUploader < CarrierWave::Uploader::Base | |
# Include RMagick or MiniMagick support: | |
# include CarrierWave::RMagick | |
# include CarrierWave::MiniMagick | |
# Choose what kind of storage to use for this uploader: | |
# storage :file |
get 'users_autocomplete', to: 'users#autocomplete' |
# input parameters (from LDAP or device attributes SERIAL, UDID) ... | |
param1 = "abcdefgh12345678" | |
param2 = "qwertyui09876543" | |
param3 = "asdfghjkl@zxcvbnml" | |
# take first 5 non-whitespace character | |
regex1 = /^\S{5}/ | |
# take last 4 non-whitespace character | |
regex2 = /\S{4}$/ |
Device.find_by_sql "select udid, count(*) from devices group by udid having count(*) > 1" |
I hereby claim:
To claim this, I am signing this object:
class Payload | |
def general_payload | |
payload = Hash.new | |
payload['PayloadVersion'] = 1 | |
payload['PayloadUUID'] = rand(10) | |
payload['PayloadOrganization'] = organization | |
payload | |
end | |
end |
<!-- Load Feather code --> | |
<!-- <script type="text/javascript" src="http://feather.aviary.com/js/feather.js"></script> --> | |
<script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script> | |
<!-- Instantiate Feather --> | |
<script type='text/javascript'> | |
var featherEditor = new Aviary.Feather({ | |
apiKey: 'API_KEY', | |
// apiKey: '<%= ENV['AVIARY_KEY'] %>', | |
apiVersion: 3, |
# builder pattern in ruby | |
# inspired by https://github.com/tboyko/ios_config | |
# and http://blog.rubygeek.com/2009/11/24/builder-pattern-in-ruby/ | |
module Payload | |
# provide base for building Payloads in Configuration Profile | |
class Base | |
def build | |
raise ArgumentError, "missing identifier" unless identifier | |