Skip to content

Instantly share code, notes, and snippets.

View ejc123's full-sized avatar

Eric.J.Christeson ejc123

  • Fargo, North Dakota, USA
View GitHub Profile
@aviflombaum
aviflombaum / adele.hello.rb
Created March 22, 2016 01:22
Opening chords of Hello by Adele in Sonic Pi
use_synth :piano
use_bpm 148
play(chord(:F1, :minor), amp: 2, release: 16)
# play(:Gs3, release: 16)
# play(:C2, release: 16)
# play(:F1, release: 16)
sleep 3
@dangkhoasdc
dangkhoasdc / lenet5.lua
Last active November 6, 2019 23:44
CNN with Torch: A simple example
-- LUA WARNINGS
-- Array starts from index 1
-- obj.func() is equivalent to obj:func()
-- Loop:
-- for start_, end_ do
-- end
-- Condition:
-- if <condition> then
-- end
-- Function:
@vysakh0
vysakh0 / any.ex
Created February 10, 2016 03:49
Remove any given character in a string just using recursion
defmodule Any do
def remove(str, char) do
remove("", str, char)
end
def remove(newstr, << char :: binary-size(1), rest :: binary >>, char) do
remove(newstr, rest, char)
end
def remove(newstr, << first :: binary-size(1), rest :: binary >>, char) do
remove(newstr <> first, rest, char)
end
@rbnpi
rbnpi / SP_RotatingBinaryRhythms.rb
Last active January 31, 2016 05:23
SP_RotatingBinaryRhythms uses an idea from http://bernhardwagner.net/musings/RPABN.html developed to give four sets of rotating rhythms playing together. Tested on Pi2 and Mac. Hear it at https://soundcloud.com/rbnman/sp-rotatingbinaryrhythms
#Rotating binary rhythms by Robin Newman, January 2016
#This piece was inspired by an article I read at http://bernhardwagner.net/musings/RPABN.html
#I played with the idea and extended it to give the current piece.
#set_sched_ahead_time! 4 #I set this when recording on a Pi2 to prevent errors
use_debug false
######### three user settings below ###########
rvol=0.6 #balance these two vol settings to taste (0-1)
lvol=1
numpasses=4 #set for number of passes required (pattern repeats after 4 passes)
module Main where
import Control.Monad.Eff
import Data.Array (replicate, (!!), updateAt)
import Data.Maybe.Unsafe (fromJust)
import Data.Nullable (toMaybe)
import Prelude
import DOM.HTML (window)
import DOM.HTML.Document (body)
@ctufts
ctufts / PhlCrime_GettingStarted_PT_I_II.R
Last active November 7, 2015 22:35
The script imports Philadelphia Crime Data Parts I and II (https://www.opendataphilly.org/dataset/crime-incidents), creates a summary based on year, month, and crime type and creates a basic map in leaflet using the first 1000 incidents
# the following script will import Philadelphia Crime Data
# Parts I and II, create a summary based on year, month, and crime type
# and will create a basic map in leaflet using the first 1000 incidents
# you will need to install dplyr, leaflet, readr, lubridate, and stringr
# packages ( install.packages('package name') )
rm(list = ls())
library(dplyr)
library(leaflet)
library(readr)