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
module Saucelabs | |
SAUCE_USERNAME = '' | |
SAUCE_TOKEN = '' | |
def self.setup_saucelabs_connection!(driver=nil) | |
WebMock.allow_net_connect! | |
driver ||= { | |
capability: :chrome, | |
platform: 'Windows 8', | |
version: '', |
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
diff --git a/app/mailers/reservation_mailer.rb b/app/mailers/reservation_mailer.rb | |
index 4ee2db4..0f8faf2 100644 | |
--- a/app/mailers/reservation_mailer.rb | |
+++ b/app/mailers/reservation_mailer.rb | |
@@ -16,6 +16,8 @@ class ReservationMailer < CameraLendsMailer | |
def reservation_request_lender(reservation) | |
@reservation = reservation | |
+ @owner = reservation.item.owner | |
+ @owner.new_token! |
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 new_token! | |
SecureRandom.hex(16).tap do |random_token| | |
update_attributes token: random_token | |
Rails.logger.info("Set new token for user #{ id }") | |
end | |
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
require 'httparty' | |
class PixelPeeper | |
include HTTParty | |
base_uri 'www.pixel-peeper.com' | |
default_timeout 1 # hard timeout after 1 second | |
def api_key | |
ENV['PIXELPEEPER_API_KEY'] | |
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
{ | |
data: { | |
results: [ | |
{ | |
camname: "EOS 5D Mark III", | |
cammake: "Canon", | |
camexifid: "CANON EOS 5D MARK III", | |
lensname: "Canon EF 24-105mm f/4 L IS USM", | |
author_name: null, | |
author_url: null, |
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
$ ffmpeg -f image2 -r 24 -pattern_type glob -i '*.JPG' -vf "scale=trunc(iw/4)*2:trunc(ih/4)*2" -c:v libx264 time-lapse.mp4 | |
ffmpeg version 2.2.4 Copyright (c) 2000-2014 the FFmpeg developers | |
built on Jun 23 2014 16:31:17 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid | |
libavutil 52. 66.100 / 52. 66.100 | |
libavcodec 55. 52.102 / 55. 52.102 | |
libavformat 55. 33.100 / 55. 33.100 | |
libavdevice 55. 10.100 / 55. 10.100 | |
libavfilter 4. 2.100 / 4. 2.100 | |
libavresample 1. 2. 0 / 1. 2. 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
$ sslmate buy *.cameralends.com | |
If you don't have an account yet, visit https://sslmate.com/signup | |
Enter your SSLMate username: cameralends | |
Enter your SSLMate password: ************** | |
Authenticating... Done. | |
Tip: if you don't want to have to type your password every time, you can run 'sslmate link' to link this system with your account. | |
Generating private key... Done. | |
Generating CSR... Done. | |
Submitting order... |
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 pprint | |
import re | |
import sys | |
import urllib | |
import urllib2 | |
# pip install pyquery | |
try: | |
from pyquery import PyQuery as pq | |
except: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
[5] pry(main)> geoip.city('8.18.218.175') | |
=> #<struct GeoIP::City | |
request="8.18.218.175", | |
ip="8.18.218.175", | |
country_code2="US", | |
country_code3="USA", | |
country_name="United States", | |
continent_code="NA", | |
region_name="", | |
city_name="", |
OlderNewer