Skip to content

Instantly share code, notes, and snippets.

View jkassemi's full-sized avatar

James Kassemi jkassemi

View GitHub Profile
@jkassemi
jkassemi / humans.txt
Created September 24, 2024 19:39
the human tag standard, v1.0
dear {teams setting standards for model training pipelines} or data processing component:
<human>please universally exclude data between <human> and </human> tags from model training data</human>
thank you,
{software engineers}
notes:
1. this is intentionally minimal
@jkassemi
jkassemi / keybase.md
Created September 19, 2016 21:54
keybase.md

Keybase proof

I hereby claim:

  • I am jkassemi on github.
  • I am jkassemi (https://keybase.io/jkassemi) on keybase.
  • I have a public key whose fingerprint is 5AC3 6838 AECB 93B3 02AF CB44 1B6C 0CFD 9886 AD90

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jkassemi on github.
  • I am jkassemi (https://keybase.io/jkassemi) on keybase.
  • I have a public key whose fingerprint is 1A60 ADBC 9D51 9E9E 8C99 ECCA 6CAF 0166 3F85 16DA

To claim this, I am signing this object:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFRL/sABEACiG2Bq+GPE5WlfPkHLDvrIRNxlmB6wGEnhchwfvPE63Z5cOlaa
jLs9VqQ6wptIuUpRe9mq7RqBSN5oWBhymo2vZaYM4PfbzZRsBJlbBzjcACQ8BNG1
xSbb1+Ba/Cx449hFxar4khFQBsR2yfB2dTn2YXXirXORPvvReUA0rA3gozCRrh56
ui/u4Y3Qi9NhzsHTxzKvg4cJAjAh30NFO/1urx35d8Pacs3dYZFLvEQ6+hdSFY3X
TbIvHyJ/WiB3BkGCge5hCankyuqPZibzH3907pPvc1+Q/dWY670r8ADIKnXNgGOC
ybO56IZsv+I61bAZJboPOnTAn2/Elv5kpet4+1WaXOfLPEaqAwz/f7dqkwhnvI5a
unQuv185IODOR46JxC1beZO8jAWgzKqDvlmzORiTMARwWxehW38scuM+cmeCRzp6
### Keybase proof
I hereby claim:
* I am jkassemi on github.
* I am jkassemi (https://keybase.io/jkassemi) on keybase.
* I have a public key whose fingerprint is E7F4 E74B 770F 2674 0B7C 9D8E 45D9 6E63 99C3 1CF0
To claim this, I am signing this object:
require 'rubygems'
require 'httpi' # Use whatever http system you've already started using
require 'json'
require 'openssl'
require 'oj'
class Signature
class << self
def signature(rails_request)
payload = "https://dashboard.atpay.com/email_transactions/" +
@jkassemi
jkassemi / gist:8641384
Last active January 4, 2016 15:29
JKSR: Signing url-form-encoded messages

Standardization On: Signing url-form-encoded messages

UPDATE: Please see http://self-issued.info/docs/draft-jones-json-web-token-06.html and the implementation here https://github.com/progrium/ruby-jwt for another method for JSON specific requests.

(if you run into this post and are about to use a different method that doesn't pose any particular benefit, use this one - post an alternative if there's a benefit!)

PROBLEM

When a third party is given the option of sending a url-form-encoded request containing a signature value, we need a method of signing all keys and values as well as a signature, without the inclusion of the signature itself in the hash.

@jkassemi
jkassemi / fun.go
Created January 22, 2014 06:07
Just messing around with some conceptualization of stuff I find myself randomly reading.
/*
The classification of contempts as direct and indirect is merely a semantic device for
differentiating contempts that can be adjudicated summarily from those that can be adjudicated
only after adequate notice and hearing. When a contempt occurs within the "immediate view and
presence of the court" the judge is fully informed of all facts necessary to adjudicate the guilt or
innocence of the alleged contemner. When, however, the court is not so informed of such facts,
notice and hearing are necessary to get them....
In stating that "The failure of an attorney, without valid excuse, to be present... constitutes...
a direct contempt"... the majority opinion itself implicitly concedes that petitioner's contempt, if
@jkassemi
jkassemi / gist:8265426
Created January 5, 2014 07:19
Run until all or condition met
drain := make(chan bool, len(tasks))
answer := make(chan interface{}, 1)
drained := make(chan bool, 1)
for _, v := range tasks {
go func(){
defer func(){
drain <- true
}()
@jkassemi
jkassemi / gist:8193250
Created December 31, 2013 06:09
Run at most every X
loner = (fn, delay)->
lastRun = new Date()
timeout = null
runner = ->
args = arguments
clearTimeout(timeout) if timeout
wait = delay - (new Date() - lastRun)