Skip to content

Instantly share code, notes, and snippets.

View mpahrens's full-sized avatar

Matthew Ahrens mpahrens

View GitHub Profile
mpahrens / Comms Module
Created July 12, 2015 01:29
Rundown of comms module to make new enchancement issues from for blockytalky_elixir
If you look at the latest develop. (July 11th) The files you can look at are:
blockytalky/lib/blockytalky/comm/comms_module.ex => the Blockytalky.CommsModule module
blockytalky/lib/blockytalky/lang/dsl.ex => the Blockytalky.DSL module
blockytalky/web/blockytalky/channels/comms_channel.ex => the Blockytalky.CommsChannel module
blockytalky/web/static/js/app.js => the client side code that reacts.
blockytalky/web/templates/view/index.html.eex => the client side html templates that turns into the main webpage. (also look at the other sub-templates that it renders. I made it fairly composable.)
Currently how sending messaging works is:
Kids right code that generates something like:
mpahrens / Run Blockytalky_elixir
Last active August 29, 2015 14:24
Run for development testing
Here are some TL;DR instructions for running blockytalky
Go into the /blockytalky/ directory
The first time you run blockytalky in dev mode you need to do the following:
- install npm node_modules
- install hex (package manager)
- install mix (task manager / install manager) tasks for phoenix (gives you phoenix.server,, phoenix.digest)
- install project libraries (dependencies)
run `npm list`. If you see ERRs, run `npm install` (on my vm I needed to `sudo npm install` due to shared folder permissions with windows
mpahrens / Release Blockytalky Elixir
Created July 12, 2015 02:10
Release steps for Blockytalky elxir
The TL;DR of the release is to make a compiled binary (that runs really fast) with erlang and elixir bundled, to just drop on a raspberry pi and run.
This has the following steps:
0) get the arm-friendly erlang (it is in the repo in a tarball)
1) Compile the fancy js and scss into plain js and css
2) Bundle the static assets into tarballs
3) Update version number or clean for rerelease
4) compile and make a release bundle and tarball
5) update the github
6) deploy on blockytalky (rpi)
#Matthew Ahrens: Nov 24th, 2015
#sets up a lambda to take the split arguments: n is the num of the shift, m is the message
# reads the codepoints from the binary representation of the message, returns 32 (\space) if space, and shifts (looping around) otherise
#uses IO.gets |> String.split(",") as an argument to the lambda
# 132 characters
fn[n,m]->for<<x<-m>>,into: "",do: <<(if x<?a,do: 32,else: rem(x+String.to_integer(n)-?a,26)+?a)>>end.(String.split IO.gets(""),",")
Building release with MIX_ENV=prod.
==> Generating relx configuration...
==> Merging custom relx configuration from rel/relx.config...
==> Generating sys.config...
==> Generating boot script...
==> Packaging consolidated protocols...
==> Conform: Loading schema...
==> Conform: Generating escript..
Compiling src/conf_parse.peg
PEG manifest updated