Skip to content

Instantly share code, notes, and snippets.

View urfolomeus's full-sized avatar

Alan Gardner urfolomeus

View GitHub Profile
##heroku
alias hp="heroku_helper production"
alias hs="heroku_helper staging"
alias hpc="heroku_helper production run console"
alias hpl="heroku_helper production logs"
alias hprdbm="heroku_helper production run rake db:migrate"
alias hsc="heroku_helper staging run console"
alias hsl="heroku_helper staging logs"

Elixir Notes

Elixir Sips

Ep 2

Numbers

1 + 1 ``

curries

01397 705 192

starters

poppodoms

  1. 2 x veg pakora
  2. 2 x chicken pakora
module EffectsTest where
import Html exposing (..)
import Html.Events exposing (onClick)
import StartApp exposing (App)
import Task exposing (Task)
import Effects exposing (Effects, Never)
exports.config = {
files: {
javascripts: {
joinTo: "js/app.js"
},
stylesheets: {
joinTo: "css/app.css"
},
templates: {
joinTo: "js/app.js"

Calculating List.length

defmodule MyList do
  def length(list) do
    length(list, 0)
  end
  
  defp length([],    count), do: count
 defp length([_|t], count), do: length(t, count + 1)
defmodule Roller do
@moduledoc """
Responsible for making dice roles.
"""
@doc """
Parses the given roll string, rolls the result and returns it.
"""
@spec roll(String.t(), function) :: integer
def roll(die_string, rand \\ :rand) do
defmodule MySum do
def sum(x, y), do: x + y
end
SELECT DISTINCT ?item ?itemLabel ?height
WHERE
{
VALUES ?o {
wd:Q48352
wd:Q2285706
}
?item wdt:P21 wd:Q6581097;
wdt:P39 ?postition.
?postition wdt:P279 ?o.
"""
" Simple D&D Flavor Text Generator
"""
import openai
import pprint
# Please sign up for an OpenAI account, generate an API key and paste it below
# https://platform.openai.com/docs/api-reference/authentication
openai.api_key = "ADD VALID OPENAI API KEY HERE"