Skip to content

Instantly share code, notes, and snippets.

View dviramontes's full-sized avatar
failing forward

David Viramontes dviramontes

failing forward
View GitHub Profile
dviramontes / .iex.exs
Created January 30, 2023 19:58
Copy to paste buffer from within iex
View .iex.exs
def copy(term) do
text =
if is_binary(term) do
inspect(term, limit: :infinity, pretty: true)
port ={:spawn, "pbcopy"}, [])
true = Port.command(port, text)
dviramontes / Brewfile
Last active January 8, 2023 18:13
View Brewfile
# install and configuration tools
brew "direnv"
brew "asdf"
brew "nvm"
# utilities
brew "caddy"
brew "watch"
brew "htop"
brew "bat"
dviramontes / host.ex
Created September 16, 2022 21:51 — forked from mrdotb/ex
Phoenix hosts management
View host.ex
defmodule AppWeb.Host do
@moduledoc """
Conveniences for working with host.
def root do
Keyword.get(get_config(), :root)
def root_uri do
Keyword.get(get_config(), :root_uri)
View i_dont_know_any_music_theory.rb
rels = (ring 0.33,1, 1.4, 2, 4) # ring allows us to `tick` aka cycle through diff values - useful for creating rhythms
times = (ring 0.25, 0.125, 0.5, 1)
live_loop :___ do
in_thread do
sample :loop_mehackit2, # this sample comes from the sonic pi library
beat_stretch: 3,
rate: 0.75, # how fast we play the given sample
decay: 6,
View gist:9e6bd9e8b97c0b54669a10df50df5992
### Keybase proof
I hereby claim:
* I am dviramontes on github.
* I am dviramontes ( on keybase.
* I have a public key ASAhg2r6QoKWwdaLWPq5os9l1sSD8M4Q8vjLI9higXOzEQo
To claim this, I am signing this object:
View App.tsx
import App from './App';
import React from 'react';
import ReactDOM from 'react-dom';
import './utils/styles/global-styles.css';
import * as serviceWorker from './services/serviceWorker';
const ws = new WebSocket("ws://")
ws.onopen = () => {
// connected
View gist:b50318c23b0f19b541777d8a9c6e7863
<div className='ui container assets'>
<div className='ui row'>
{ loading ?
<Loading /> :
<table className='ui padded table'>
View cmd-args.go
// print name of calling program,
// list args passed each on a new line,
// print time elapsed
package main
import (
dviramontes / flattenArray.js
Created September 10, 2017 21:53
flatten array of arbitrary length
View flattenArray.js
function flattenArray(arr) {
return arr.reduce((acc, e) => {
return acc.concat(flattenArray(e));
return acc;
}, []);
dviramontes /
Last active July 15, 2017 16:29
running with scissors and exercism


Lets get you setup with


  1. Let's check you NPM version: npm -v if version> 5; we're are good to go, skip to step 2

  2. else: let's update the npm!