Skip to content

Instantly share code, notes, and snippets.

@yedi
yedi / chatgpt-aiortc-webcam-client-2.cljs
Last active February 23, 2023 02:29
ChatGPT's version of aiortc's webcam example client.js
;; I asked chatGPT to convert this JS code to ClojureScript
;; https://raw.githubusercontent.com/aiortc/aiortc/main/examples/webcam/client.js
(def pc (atom nil))
(defn check-state [resolve]
(fn []
(if (= (.-iceGatheringState @pc) "complete")
(resolve)
(do

Keybase proof

I hereby claim:

  • I am yedi on github.
  • I am yedi (https://keybase.io/yedi) on keybase.
  • I have a public key ASCcnOJHvY2IpSVQAItg1-Iu4fuTF32eZTSBIod7oUkc4go

To claim this, I am signing this object:

@yedi
yedi / deploying.txt
Created July 25, 2016 14:28
deploying to scraper01
sudo su - ev
supervisorctl stop all
cd workers/ev_workers
git pull to whatever tag (or head in staging)
cd ../ev_common
git pull to whatever tag (or head in staging)
cd ..
supervisorctl start all
@yedi
yedi / fn.py
Last active July 17, 2016 16:39
def gen_get_resp(body=body, **kw):
responded_once = False
def get_resp(url, body=body, **kw):
if not responded_once:
responded_once = True
return mockresp
else:
return MockResponse(body=[])
return get_resp
vagrant@vagrant-ubuntu-wily-64:~/workers$ sudo rm -rf node/
rm: cannot remove ‘node/bin’: Directory not empty
rm: cannot remove ‘node/include’: Directory not empty
rm: cannot remove ‘node/lib’: Directory not empty
rm: cannot remove ‘node/share’: Directory not empty
vagrant@vagrant-ubuntu-wily-64:~/workers$ sudo rm -R node/
rm: cannot remove ‘node/bin’: Directory not empty
rm: cannot remove ‘node/include’: Directory not empty
rm: cannot remove ‘node/lib’: Directory not empty
rm: cannot remove ‘node/share’: Directory not empty
strings = ["first", "second", "third"]
ret = False
line = get_line()
for s in strings:
if s in line:
ret = True
break
#Modified code
visit_pull_times <- function (db, limit=-1, offset=-1) {
con <- db$con
query <- 'select visit.id, visit.time_start, visit.time_end
from form, visit
where form.visit_id = visit.id
group by visit.id, visit.time_start, visit.time_end'
with_limit <-(limit > 0)
if (with_limit) {
@yedi
yedi / gist:3272ab3d33d8b5966b65
Last active October 13, 2015 04:08
nyc ranking no activity req
0 dudutsai 20312.23
1 Hax 46.403
2 The Moon 41.600
3 Vanz 40.307
4 Swedish Delight 38.892
5 DJ Nintendo 37.993
6 G$ 36.797
7 Zanguzen 36.629
8 Leffen 36.398
9 dizzkidboogie 36.161
@yedi
yedi / gist:5a733656b76d42abb8e1
Last active October 12, 2015 23:28
nyc ranking draft
As of 2015-09-13
Rank Name Rating
1 The Moon 41.600
2 Vanz 40.307
3 DJ Nintendo 37.993
4 G$ 36.797
5 dizzkidboogie 36.161
6 Captain Smuckers 36.079
7 Jsex 35.948
8 OTG 35.288
@yedi
yedi / gist:33390594bbe6b4d272a3
Created October 12, 2015 20:48
nebs + max only ranking with no cutoff and with activity requirement
As of 2015-09-13
Rank Name Rating
1 The Moon 42.422
2 Vanz 41.159
3 DJ Nintendo 38.877
4 dizzkidboogie 38.055
5 G$ 37.466
6 Captain Smuckers 36.697
7 Jsex 36.437
8 OTG 35.816