- MAMP: https://www.mamp.info/en/downloads/
- Craft CMS: https://craftcms.com/pricing
- Open up MAMP
- Preferences -> Web Server
- Change Document Root to public folder in Craft CMS download
- Start Servers
- Preferences -> Web Server
- If it doesn't open automatically hit "open WebStart page"
- tools -> phpMyAdmin
- top left "new" button
- database name: project_name
// Calling find_prime_factors on numbers that functional languages can easily handle | |
// will cause a stack size exception. JS can't handle functional programming. :) | |
// http://jsbin.com/qakodivepe/edit?js,console | |
// try: | |
// primeFactors(10) | |
// primeFactors(7775460) | |
// primeFactors(7919) | |
// primeFactors(1056884) <- Boom, stack size exception | |
// Entry point |
// Tell me what is going on here: | |
function oneHitter(name, val){ | |
if(!oneHitter.cache) oneHitter.cache = {}; | |
if(!oneHitter.cache[name]) oneHitter.cache[name] = val | |
return oneHitter.cache[name]; | |
} | |
// Tell me what's going on here': | |
var days = ["sun","mon","tues","wed","thurs","fri","sat"]; | |
function lastElement(arr){ |
defmodule OppositeDay do | |
defmacro opposite_day(do: block) do | |
do_opposite(block) | |
end | |
def do_opposite({:==, c, a}), do: {:!=, c, a} | |
def do_opposite({:!=, c, a}), do: {:==, c, a} | |
def do_opposite({:-, c, a}), do: {:+, c, a} | |
def do_opposite({:+, c, a}), do: {:-, c, a} | |
def do_opposite({:*, c, a}), do: {:/, c, a} |
/** | |
* You may use this code for free on any web page provided that | |
* these comment lines and the following credit remain in the code. | |
* Cross Browser Fireworks from http://www.javascript-fx.com | |
*/ | |
/*************************************************/ | |
if(!window.JSFX) JSFX=new Object(); | |
if(!JSFX.createLayer) | |
{/*** Include Library Code ***/ |
module Main where | |
import Html exposing (div,button,Html,text,Attribute) | |
import Html.Events exposing(onClick) | |
import Html.Attributes exposing (style) | |
import StartApp.Simple exposing (start) | |
type alias Model = Int | |
type Action = Increment | Decrement |
The Phoenix Framework was built with realtime communication as a first class priority. Using its built in socket handling and channels we can implement a basic, realtime chat application with little effort.
For this video we’re going to assume that you already have Elixir and Phoenix Setup. You will not need a database as the messages will not be persisted. This tutorial is taken pretty much directly from the Phoenix Documentation.
To start let’s generate a standard phoenix application:
$> mix phoenix.new instachat
By the end of this lesson students should be able to:
- Demonstrate a use case that explains prototypal inheritance
- Demonstrate what kind of flexibility prototypal inheritance gives programmers
In this lesson we are going to learn about a type of inheritance called Prototypal Inheritance. We are going to see how with prototypes we can share functionality between related objects. We are going to see how with Object.create we can easily set up prototypes and how we can extend prototypes to easily add functionality.
Old standby for a quick look into your code
Works with anything that implements the String.Chars protocol, AKA the to_string method. Elixir ships with: https://github.com/elixir-lang/elixir/blob/e769afbed96b6b9eee6a4f4ac4a6ea00bc0630f7/lib/elixir/lib/string/chars.ex
Returns the term handed to it untouched so you can plop it straight in your code
I hereby claim:
- I am itsgreggreg on github.
- I am greggreg (https://keybase.io/greggreg) on keybase.
- I have a public key whose fingerprint is EEE7 1FC8 7328 62C1 7482 5689 8749 2ABC 1645 F5B7
To claim this, I am signing this object: