Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
distracted like an adhd squirrel

Benjamin Rhodes nerdyworm

:shipit:
distracted like an adhd squirrel
View GitHub Profile
View keybase.md

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 Aug 5, 2018
Upload a file with ocaml, cohttp, and lwt without reading the entire file to memory.
View upload.ml
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 Jun 23, 2017
All the packages required to install ember cli deploy s3
View install-ember-cli-deploy.sh
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
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View components.video-player.js
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 Jul 30, 2016
rename a phoenix project
View rename.sh
#!/bin/bash
set -e
CURRENT_NAME="CurentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
isLoading: true,
actions: {
onLoad() {
this.set("isLoading", false);
}
}
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
things: false,
});
View application.controller.js
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());
You can’t perform that action at this time.