Skip to content

Instantly share code, notes, and snippets.

View nerdyworm's full-sized avatar
:shipit:
distracted like an adhd squirrel

Benjamin Rhodes nerdyworm

:shipit:
distracted like an adhd squirrel
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nerdyworm on github.
  • I am benrhodes (https://keybase.io/benrhodes) on keybase.
  • I have a public key ASC3NQIWDjb2xAmtZGzFfm_GNyx7JPeduf7REN2bJ2jL-Ao

To claim this, I am signing this object:

@nerdyworm
nerdyworm / upload.ml
Created August 5, 2018 03:25
Upload a file with ocaml, cohttp, and lwt without reading the entire file to memory.
open Lwt
open Cohttp
open Cohttp_lwt_unix
let read fd () =
let buffer = Bytes.create 1024 in
let%lwt len = Lwt_unix.read fd buffer 0 1024 in
match len with
| 1024 -> Lwt.return(Some (Bytes.to_string buffer))
| 0 -> Lwt.return(None)
@nerdyworm
nerdyworm / install-ember-cli-deploy.sh
Created June 23, 2017 15:32
All the packages required to install ember cli deploy s3
ember install ember-cli-deploy ember-cli-deploy-build ember-cli-deploy-display-revisions ember-cli-deploy-gzip ember-cli-deploy-revision-data ember-cli-deploy-s3 ember-cli-deploy-s3-index
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
extracts: {'one_big_rabbit':[7,11], 'three_rodents':[12,14.5]},
interv: null,
actions: {
play(extractToPlay) {
let video = this.$("video")[0];
let from = this.get('extracts')[extractToPlay][0];
@nerdyworm
nerdyworm / rename.sh
Created July 30, 2016 17:40
rename a phoenix project
#!/bin/bash
set -e
CURRENT_NAME="CurentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
isLoading: true,
actions: {
onLoad() {
this.set("isLoading", false);
}
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
things: false,
});
import Ember from 'ember';
export default Ember.Controller.extend({
delta: 0,
_interval: null,
startTime: null,
timer: Ember.computed('delta', function() {
const that = this;
if (this._interval === null) {
this.set('startTime', Date.now());