Skip to content

Instantly share code, notes, and snippets.

View andeemarks's full-sized avatar

Andy Marks andeemarks

View GitHub Profile
import Html exposing (Html, text, input, div)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)
import String
main = Html.program { init = init,
view = view, update = update, subscriptions = \_ -> Sub.none }
-- Model
import Html exposing (Html, text, div)
import Mouse exposing (..)
main = Html.program { init = init,
view = view, update = update, subscriptions = subscriptions }
-- Model
type alias Model = { x: Int, y : Int }
import Html exposing (Html, text, div)
import Mouse exposing (..)
main = Html.program { init = init,
view = view, update = update, subscriptions = subscriptions }
-- Model
type alias Model = { count: Int }
import Html exposing (Html, text, div)
import Mouse exposing (..)
main = Html.program { init = init,
view = view, update = update, subscriptions = subscriptions }
-- Model
type alias Model = { count: Int }
import Html exposing (Html, text, div)
-- import Html.App as App
import Mouse exposing (..)
main = Html.program { init = init,
view = view, update = update, subscriptions = subscriptions }
-- Model
type alias Model = { x: Int, y: Int }
3 3 * 4 4 * + .
3 sq 4 sq sqrt .
[ dup ] dip
"Hello, " swap append >upper
{ 1 4 17 9 11 } 0 [ + ] reduce .
100 [1,b] 0 [ + ] reduce .
10 [1,b] [ sq ] map .
42 [ 10 /i ] [ 10 mod ] bi .
1234 number>string [ 1string string>number ] each
function retry(count, body)
for i = 1, count do
coro = coroutine.create(body)
coroutine.resume(coro)
if (coroutine.status(coro) == "dead") then
print(i)
return
end
end
@andeemarks
andeemarks / lua-exercises-day-1.lua
Last active January 21, 2018 02:59
Answers to exercises from Day 1 of learning Lua from "7 More languages in 7 weeks"
function ends_in_3(num)
return string.sub(string.reverse(num), 1, 1) == "3"
end
print("Checking ends_in_3...")
print(ends_in_3(3))
print(ends_in_3(2))
print(ends_in_3(0))
function is_prime(num)

Keybase proof

I hereby claim:

  • I am andeemarks on github.
  • I am vampwillow (https://keybase.io/vampwillow) on keybase.
  • I have a public key ASCoX_CgrBl3fDwhR82QCYVvNmEcp-JvILoBsFsXos1nwAo

To claim this, I am signing this object:

@andeemarks
andeemarks / erlang-start-pong-process
Created March 13, 2012 06:14
Erlang start Pong process
(pong@127.0.0.1)4> tut17:start_pong().
true
Pong received ping
Pong received ping
Pong received ping
Pong finished
(pong@127.0.0.1)5>