Skip to content

Instantly share code, notes, and snippets.

@dodeja
dodeja / socksify_faraday.rb
Created August 10, 2016 22:30 — forked from andrey-kazakov/socksify_faraday.rb
HTTP over SOCKS support monkey patch for Mechanize, Faraday and it's based clients (OAuth2 like)
# requires socksify gem
require "socksify"
require 'socksify/http'
# use w/ OAuth2 like OAuth2::Client.new(id, secret, connection_opts: { proxy: 'socks://127.0.0.1:9050' })
class Faraday::Adapter::NetHttp
def net_http_class(env)
if proxy = env[:request][:proxy]
if proxy[:uri].scheme == 'socks'
Net::HTTP::SOCKSProxy(proxy[:uri].host, proxy[:uri].port)
@dodeja
dodeja / urls
Created January 24, 2013 21:42 — forked from anonymous/urls
http://localhost:9200/locations/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["-1831663469"]&source={"sort":{"size_estimate":{"order":"desc"}},"size":1,"filter":{"geo_distance":{"distance":"100km","location":{"lat":35.236514,"lon":-89.922871}}}}&_=1359063233523
@dodeja
dodeja / urls
Last active December 11, 2015 16:28 — forked from anonymous/urls
http://localhost:9200/locations/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["-1831663469"]&source={"sort":{"size_estimate":{"order":"desc"}},"size":1,"filter":{"geo_distance":{"distance":"100km","location":{"lat":35.236514,"lon":-89.922871}}}}&_=1359063233523
http://localhost:9200/events/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["1549501024"]&source={"query":{"bool":{"must":[{"range":{"start_time":{"gte":"2013-01-25T01:59:59Z","lt":"2013-07-24T06:59:59Z"}}},{"field":{"featured_artist":true}}]}},"sort":[{"start_time":{"order":"asc"}}],"filter":{"geo_distance":{"distance":"50km","location":{"lat":35.1187171875,"lon":-89.9533898438}}},"size":15,"from":0}&_=1359063298321
http://search.livenation.com/events/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["-2121642443"]&source={"query":{"bool":{"must":[{"range":{"start_time":{"gte":"2013-01-24T23:59:59Z","lt":"2013-07-24T04:59:59Z"}}},{"field":{"featured_artist":true}}]}},"sort":[{"start_time":{"order":"asc"}}],
@dodeja
dodeja / hack.sh
Last active December 11, 2015 00:19 — forked from caycefischer/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2279031/hack.sh | sh
#
@dodeja
dodeja / Dev Show 24
Created September 20, 2010 06:52 — forked from jseifer/Dev Show 24
http://antirez.com/post/autocomplete-with-redis.html
http://praegnanz.de/html5video/
http://briancray.com/2010/09/08/html5-microdata/
http://diveintohtml5.org/extensibility.html
http://www.quirksmode.org/blog/archives/2010/09/testing_blackbe.html
http://intridea.com/2010/9/13/a-web-developer-goes-native-with-android
http://nvie.com/posts/how-i-boosted-my-vim/
http://onebuttonmouse.com/ramblings/domainbrain-2-0-is-now-available/
http://www.tuttoaster.com/ruby-for-php-developers/
http://blog.brandonbloom.name/2010/09/how-two-pythonistas-accidentally-fell.html
# Amazon FPS Plugin
require 'net/https'
require 'time'
require 'openssl'
require 'base64'
require 'yaml'
module AWS_FPS
# Load AWS config
path = File.expand_path "#{RAILS_ROOT}/config/amazon_fps.yml"
class PaymentController < ApplicationController
require 'rexml/document'
def index
@caller_token = AWS_FPS::Tokens.get_caller_token
@recipient_token = AWS_FPS::Tokens.get_recipient_token
end
def amazon_pipeline
return_path = "payment/pay"
<!-- To display the "Feedback" widget on the right rather than the left,
add these styles below the code provided by Get Satisfaction.
Tested in IE6, IE7, Firefox 2, Firefox 3, and Safari 3.
See it in action at http://www.sunagocommunity.org/
Note: You'll need to download the modified background image from
http://sunagocommunity.org/images/feedback-mod.png and place it in your
/images/ folder (or edit the location below). Please serve this image
yourself rather than pulling it from the Sunago app server kthx.