Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am fredantell on github.
  • I am fredantell (https://keybase.io/fredantell) on keybase.
  • I have a public key ASDjnCICpOk2zWSYOts1ZbpaxHwLSX43aNYVmKClwzzTSgo

To claim this, I am signing this object:

@fredantell
fredantell / gist:cb351cd3b37945b7b24b
Last active August 29, 2015 14:03
Grab subtitles
var postURLs = [];
var movieLinks = $('dl dt b a');
var transcriptData = [];
var extractSubs = function(subs) {
var output = '';
var start;
var end;
var text = '';
@fredantell
fredantell / gist:10933968
Created April 16, 2014 21:16
kernel time search timeout function
(defn handle-search-change [event owner state]
"Takes the event value, which represents a string the user entered into the search field.
After updating the state, we sleep using a timeout. On wake query the component for the most up to date value. Then wake and check if the component's most up to date state still matches what was passed to the function.
If it is, that means no changes to the desired search string have occurred. Put the search string onto a channel where it can be consumed elsewhere to make an ajax call. If the values don't match, then do nothing."
(let [e-val (.. event -target -value)]
(om/set-state! owner :text e-val)
(go
(<! (timeout 1000))
(let [should-send? (= e-val (om/get-state owner :text))]