Navigation Menu

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, 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 / meetup-events.go
Created September 9, 2014 09:28
Getting upcoming Meetup events in Golang
package main
import "net/http"
import "log"
import "os"
import "io/ioutil"
import "encoding/json"
// import "time"
@andeemarks
andeemarks / gist:3a4e845e919ee8185608
Created August 26, 2014 23:34
Hard-coding Vagrant CentOS guest timezone
config.vm.provision "shell" do |s|
s.inline = "sudo ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime; echo $?"
end
@andeemarks
andeemarks / erlang-start-ping-process
Created March 13, 2012 06:14
Erlang start Ping process
(ping@127.0.0.1)7> tut17:start_ping('pong@127.0.0.1').
<0.51.0>
Ping received pong
Ping received pong
Ping received pong
ping finished
(ping@127.0.0.1)8>