Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Yorke bendyorke

View GitHub Profile
@bendyorke
bendyorke / original.txt
Last active Apr 10, 2020
Sourcegraph Library Discussion
View original.txt
- find the column and line number related to where the cursor is
- find the token underneath the cursor using some sort language parsing
- leverage the syntax highlighting to determine tokens (individual HTML Elements)
- this would help with the onTokenEnter and onTokenLeave priciples
- make API call to get the hover contents back from the api
- so long as the cursor stays over the current token, show a loading indicator
- it can't jusst on cursor move, onTokenEnter
- onTokenLeave stop the request/ignore the request
- once you get the content back, replace the loading indicator with the content
- you could cache the content in case the user hovers back over the same token in a given session
View keybase.md

Keybase proof

I hereby claim:

  • I am bendyorke on github.
  • I am bendy (https://keybase.io/bendy) on keybase.
  • I have a public key ASCZaxEmvkro519HaeloPFxmB3JIGgUQhCT1J88GeCLDxgo

To claim this, I am signing this object:

@bendyorke
bendyorke / cat-task-cron.sh
Last active Jul 3, 2016
CatFacts code for webtask.io
View cat-task-cron.sh
wt cron schedule --name cat-facts \
--param to=<ENEMY_PHONE_NUMBER> \
--secret SID=<TWILIO_SID> \
--secret TOKEN=<TWILIO_TOKEN> \
--secret NUMBER=<TWILIO_NUMBER> \
"<CRON SCHEDULE>" \
<PATH_TO_FILE>
@bendyorke
bendyorke / zero_to_mega_clojure.clj
Last active May 18, 2016
Playing around with zero_to_clojure.clj
View zero_to_mega_clojure.clj
#! /usr/bin/env boot
(set-env! :dependencies '[[compojure "1.5.0"]
[http-kit "2.1.8"]])
;; You can pass as many packages as you want to require,
;; so no need to invoke it twice!
(require '[compojure.core :refer [defroutes GET POST]]
'[org.httpkit.server :refer [run-server]])
(defn greet [greetee]
@bendyorke
bendyorke / zero_to_clojure.clj
Last active May 13, 2016
Fully featured clojure web server in 10 lines of code
View zero_to_clojure.clj
#! /usr/bin/env boot
(set-env! :dependencies '[[compojure "1.5.0"]
[http-kit "2.1.8"]])
(require '[compojure.core :refer [defroutes GET]])
(require '[org.httpkit.server :refer [run-server]])
(defroutes routes
(GET "/" [] "Hello World!"))
View todo
#!/usr/bin/env python
"""http://stevelosh.com/projects/t/#installing-t | http://bitbucket.org/sjl/t/"""
"""t is for people that want do things, not organize their tasks."""
from __future__ import with_statement
import os, re, sys, hashlib
from operator import itemgetter
from optparse import OptionParser, OptionGroup
@bendyorke
bendyorke / setup.md
Last active Mar 12, 2021
Setting up a new mac
View setup.md
@bendyorke
bendyorke / benchmark.rb
Created May 20, 2014
Benchmarking sampling of a hash
View benchmark.rb
require "benchmark"
n = 10000
arr = (1..1000).to_a
zip = arr.zip arr
hash = Hash[zip]
Benchmark.bm do |x|
x.report("%-30s" %["sampling array"]) { n.times do
arr.sample
View game_of_life.rb
module GameOfLife
def self.play input, n
# return 42 if input == "the universe and everything"
@board = make_board_from input
n.times { age!; print_board; sleep(0.2) }
end
def self.age!
results = parse_cells
process results
View gist:6059481
<snippet>
<content><![CDATA[
<form action="/${1:url}" method="post">
<input type="${2:text}" name="$3">
<input type="${4:password}" name="$5">
${6:<input type="submit" value="Submit">}
</form>$0
]]></content>
<tabTrigger>frmzplz</tabTrigger>
<scope>text.html - ruby</scope>