Skip to content

Instantly share code, notes, and snippets.

@jkassemi
jkassemi / gist:7746307
Created December 2, 2013 07:40
Drone delivery range - RE: Amazon
Given
1) A drone can carry a recharge load for another drone
2) A drone can fly 2*X distance before a recharge
3) A drone must leave point A, reach point B, and return to point A.
If distance AB < X then no recharge is required.
If distance AB == 2X then
Drone 1 flies to <X
Drone 2 flies to <X, charges Drone 1, returns to A
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (Darwin)
hQIMAw+MY6dm20KGAQ//ZKHiKW1q9Teo3C66GvVV2jPbfyI+XhTKnAnJQe6uHCtn
tNBw8qjbfADGqaEkX/drrWBhLeiuYaE1EzkNj9dxrLy1Z2ZoX8tT8U/uKpyIpZXZ
KBtY++g7vnJJPMJ90f8MEyEqejzggXFjwGkhVaV9e1b1KFq8YOJjLVKd2tGTctia
RZUC2wZGBAGvUcuHxvX4cTKUwENgnNUqZRLLO6X4YvZCtpNdIoxbipFc9ENeZgGw
ApDwOJIDcFVI+dEu661pqUBRok4+dQiQ6PLMNNTIfHQ3898lFuYkrYm2bGA0Z5VK
mSUP4HiYL9zNq0hzRmpDjyccXRhH7pJw5RbGYVEOVetMM86tLZPkul7IbHJ0wErO
MSYw3nZK5lwQPcjMPJugTpzy/f7pPWeK8qthsBX/I71gF0rx9QEatgm5kEEeq6So
@jkassemi
jkassemi / gist:7621426
Created November 23, 2013 23:39
Server / Client Form Validation - Reminder
1) Render content for page
2) Parse form contents from page before delivery, parse validation fields, save, sign, inject content
3) Validate signature on validation content on form, validate according to HTML form validation rules.
@jkassemi
jkassemi / gist:7034805
Created October 18, 2013 00:47
Watch files, make. Easy.
# https://news.ycombinator.com/item?id=6568137
inotifywait -m -e modify,close_write,move,move_self,create,delete,delete_self -r . | while read; do make; done

Description

Dashing widget to show the build status of a CircleCI project.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then:

@jkassemi
jkassemi / gist:3797001
Created September 27, 2012 23:09
Select2.js capybara
def select2_select(text, options)
page.find("#s2id_#{options[:from]} a").click
page.all("ul.select2-results li").each do |e|
if e.text == text
e.click
return
end
end
end