Skip to content

Instantly share code, notes, and snippets.

View gist:c858b8b87f441d1df69b0732b39e2d3c
### Keybase proof
I hereby claim:
* I am hakanensari on github.
* I am hakanensari (https://keybase.io/hakanensari) on keybase.
* I have a public key ASCvhfbQGv5UmxeNCofiB_qe-UcdjO6Sd-tRH_Co53OJuQo
To claim this, I am signing this object:
View cloudSettings
{"lastUpload":"2020-11-06T16:22:39.166Z","extensionVersion":"v3.4.3"}
View 0912383119.json
{
"Request": {
"IsValid": "True",
"ItemLookupRequest": {
"Condition": "All",
"DeliveryMethod": "Ship",
"IdType": "ASIN",
"MerchantId": "All",
"OfferPage": "1",
"ItemId": "0912383119",
@hakanensari
hakanensari / bm.rb
Created Dec 15, 2015
The cost of binding lambdas to context in Ruby
View bm.rb
require 'benchmark'
foo = -> {}
_ = BasicObject.new
def _.bar
end
n = 4_000_000
@hakanensari
hakanensari / circle.yml
Created Nov 16, 2015 — forked from jonah-williams/circle.yml
Automating deployments to Heroku from CircleCI
View circle.yml
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@hakanensari
hakanensari / bleh.coffee
Created Nov 10, 2014
capture screenshot from video etc.
View bleh.coffee
$capture = $ ".capture"
$capture.change (event) ->
file = @files[0]
event.preventDefault()
# Capture first frame of video
video = document.createElement("video")
video.src = URL.createObjectURL(file)
video.style.visibility = "hidden"
View mws.xml
<Notification>
<NotificationMetaData>
<NotificationType>AnyOfferChanged</NotificationType>
<PayloadVersion>1.0</PayloadVersion>
<UniqueId>14baf090-6a81-4d13-b1ad-340363d569d8</UniqueId>
<PublishTime>2014-02-23T11:35:40.497Z</PublishTime>
<SellerId>MERCHANT_ID_1</SellerId>
<MarketplaceId>A2EUQ1WTGCTBG2</MarketplaceId>
</NotificationMetaData>
<NotificationPayload>
View hash_dig.rb
class Hash
def dig(key)
each.find do |k, v|
return v if k == key
v.dig(key) if v.is_a?(Hash)
end
end
end
@hakanensari
hakanensari / promo.sh
Created Apr 29, 2014
Pomodoro & Programming, Motherfucker Mashup
View promo.sh
#!/bin/bash
for i in {1..4}
do
for ITS in start stop
do
say "$ITS programming, motherfucker."
[[ $ITS = start ]] && sleep 1500 || sleep 300
done
done
@hakanensari
hakanensari / request.rb
Last active Aug 29, 2015
Minimal Ruby interface for the Amazon MWS API
View request.rb
require 'jeff'
module MWS
class Request
include Jeff
HOSTS = {
'A2EUQ1WTGCTBG2' => 'mws.amazonservices.ca',
'AAHKV2X7AFYLW' => 'mws.amazonservices.com.cn',
'A1PA6795UKMFR9' => 'mws-eu.amazonservices.com',
You can’t perform that action at this time.