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
Verifying my Blockstack ID is secured with the address 1DcoBDY6S7QELM7qvmgqibASxd3jP2L2kB https://explorer.blockstack.org/address/1DcoBDY6S7QELM7qvmgqibASxd3jP2L2kB |
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
Resque.working.select{|w| DateTime.parse(w.job["run_at"]) < 5.hours.ago }.map do |worker| | |
worker.shutdown | |
worker.unregister_worker | |
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
SELECT orders.id, orders.vanity_id, orders.payment_state, orders.confirmed_at, orders.store_id, store_subdomain from orders WHERE orders.vanity_id < 100000 and orders.confirmed_at > DATE_SUB(NOW(), INTERVAL 5 DAY) AND orders.store_id IN (528222, 18784) order by vanity_id, store_id; |
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
... | |
<li class="product" id="products_{{product.id}}"> | |
<a href="{{product.url}}"> | |
<span class="{{ product.css_class }}"> | |
{% if product.on_sale %} | |
<img src="/themes/default/images/label-onsale.png" width="98" height="98" alt="On Sale" /> | |
{% endif %} | |
{% if product.preorder %} | |
<img src="/themes/default/images/label-preorder.png" width="98" height="98" alt="Pre-Order" /> | |
{% endif %} |
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
# Redis is faster than Mysql so it may cause a RecordNotFound to happen if enqueued from after_create | |
before_create :set_recently_opened | |
after_commit :if => :recently_opened? do |record| | |
Resque.enqueue StoreAfterCreate, record.id | |
UserMailer.store_signup(record.owner_user_id, record.id).deliver | |
end | |
def set_recently_opened | |
@recently_opened = true | |
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
self.send_later :update_associations | |
Resque.enqueue UpdateAssociations, self.id |
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
/* Add this CSS to your store Styles section under CSS mode */ | |
/* http://www.storenvy.com/ */ | |
/* Photo Slider */ | |
.product_photo_slider { | |
background: #fff; /*: Product Slider Background :*/ | |
border: 5px solid #eaeaea; /*: Product Slider Border :*/ | |
color: #555; /*: Product Slider Product Description :*/ | |
display: block; | |
margin-left:8px; |
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
class VisitorStats | |
def initialize | |
@redis = Redis.new | |
end | |
# every time there's a hit, increment a counter for the | |
# day and week, and add the session id to a set of unique | |
# vistitors for the day/week | |
def hit(session_id) | |
today = Date.today |
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
# Bash snippet to open new shells in most recently visited dir. | |
# Useful if you want to open a new terminal tab at the present | |
# tab's location. | |
# | |
# Put this in your .bashrc or whatever. | |
pathed_cd () { | |
if [ "$1" == "" ]; then | |
cd | |
else |
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
def random_elements(arr, num_items) | |
el = arr.dup | |
results = [] | |
num_items.times{results << el.delete(el[rand(el.size)])} | |
return results | |
end | |
random_elements((1..10000).to_a, 25) |
NewerOlder