Skip to content

Instantly share code, notes, and snippets.

David Mohl dvcrn

Block or report user

Report or block dvcrn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dvcrn / mona.applescript
Last active Nov 20, 2017
Fetch crypto price in applescript
View mona.applescript
# example to fetch the current MONA price in JPY
# needs
# replace 'neo' with any other ID supported by coinmarketcap
# using coinmarketcaps convert API to add `price_jpy` to the result
set json_data to (do shell script "curl")
tell application "JSON Helper"
set json_data to read JSON from json_data
end tell
dvcrn / main.cljs
Created Dec 29, 2016
realm example in clojurescript
View main.cljs
(def Realm (js/require "realm"))
;; define dog schema
(def dog {:name "Dog"
:properties {:name "string"
:age "int"}})
;; instantiate Realm with the dog schema
(def r (Realm. (clj->js {:schema [dog]})))

Keybase proof

I hereby claim:

  • I am dvcrn on github.
  • I am dvcrn ( on keybase.
  • I have a public key ASD90ukgjRDay6u9VaMUG_WeXf4xhzUAhUVgaG7Di83jzwo

To claim this, I am signing this object:

dvcrn / reagent-animated-example.cljs
Last active Jan 9, 2019
reagent react-native animation example
View reagent-animated-example.cljs
;; very simple example on how to use Animated with reagent
(def animated (.-Animated js/React))
(def animated-value (.-Value animated))
(def animated-view (r/adapt-react-class (.-View animated)))
(defn testview []
dvcrn / gist:d3b1fe416c017499ddfa
Created Jul 6, 2015
linear regression with 1 variable in python
View gist:d3b1fe416c017499ddfa
testset = [
[1, 4],
[2, 8],
[3, 12],
[4, 16]
theta0 = 0
theta1 = 0
learningrate = 0.01
dvcrn / gist:95b42a5c7c61860ea2af
Created Jun 16, 2015
Launch or create a new window if already running
View gist:95b42a5c7c61860ea2af
emacs () {
number=$(ps aux | grep $PROCESS | wc -l)
if [ $number -gt 1 ]
emacsclient -c -n $1
open -a /usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.8/ $1
dvcrn / s3 prerender
Created Mar 16, 2014
prerender script used for generating static pages for
View s3 prerender
fs = require 'fs'
webpage = require 'webpage'
page = webpage.create()
renderedUrls = 0
totalUrls = 0
# Taken from
# Converted into coffee
waitFor = (testFx, onReady, timeOutMillis) ->
maxtimeOutMillis = (if timeOutMillis then timeOutMillis else 5000) #< Default Max Timout is 3s
dvcrn / gist:3847689
Created Oct 7, 2012
Parse twitter urls, hashtags and usernames
View gist:3847689
parse_tweet = function (str) {
var create_link = function (url, text) {
var link = $("<a>", {
text: text,
href: url,
target: "_blank"
return link.prop('outerHTML');
dvcrn /
Created Sep 25, 2012
Bing download url crawler
from pybing import Bing
from urllib2 import HTTPError
from BeautifulSoup import BeautifulSoup
from pybing import constants
import re
import mechanize
import simplejson
searchstring = "cows" # your search string here
searchcount = 40
dvcrn /
Created Oct 2, 2011
SpaceSphere - A Twitter Autoreply Bot
#!/usr/bin/env python
import sys
from twython import Twython
import random
ACCESS_KEY = 'xxxx'
You can’t perform that action at this time.