Skip to content

Instantly share code, notes, and snippets.

module Page.Helper.Dropdown exposing (Dropdown, Msg(..), init, isDroppedDown, itemHasBeenClicked, update)
-- TYPES
type Dropdown
= Internal { show : Bool, itemClicked : Bool }
init : Dropdown
module Main exposing (main)
import Browser
import Element exposing (Element)
import Html exposing (Html)
import Html.Attributes
main : Program () () msg
main =
module InfiniteScroll
exposing
( Model
, Msg(..)
, init
, subscriptions
, timeout
, offset
, direction
, loadMoreCmd
@roovo
roovo / gist:3ede89946b6a8203851a41cca9003ff7
Last active September 8, 2018 18:11
Verifying my Blockstack ID is secured with the address 1GS2wVjHQKE8YZKqMQL5A4N1xfdBksSR76 https://explorer.blockstack.org/address/1GS2wVjHQKE8YZKqMQL5A4N1xfdBksSR76
Verifying my Blockstack ID is secured with the address 1GS2wVjHQKE8YZKqMQL5A4N1xfdBksSR76 https://explorer.blockstack.org/address/1GS2wVjHQKE8YZKqMQL5A4N1xfdBksSR76
@roovo
roovo / CanvasTexture.elm
Created April 11, 2017 16:07
elm: stuff wot I did to get text from canvas into webGL
module CanvasTexture exposing (canvasTexture)
-- imports are weird for Native modules
-- You import them as you would normal modules
-- but you can't alias them nor expose stuff from them
import Task exposing (Task)
import WebGL exposing (Error, Texture)
import Native.CanvasTexture
-- this will be our function which returns a number plus one
diff --git a/examples/crate.elm b/examples/crate.elm
index a94c4c1..756f8c5 100644
--- a/examples/crate.elm
+++ b/examples/crate.elm
@@ -53,8 +53,8 @@ main =
-- MESHES
-crate : Drawable { pos:Vec3, coord:Vec3 }
-crate =
var _user$project$Native_CanvasTexture = function() {
function higherPow2(aSize){
return Math.pow(2, Math.ceil(Math.log(aSize) / Math.log(2)));
}
function makeTextCanvas(context, text, fontSize, width, height) {
context.canvas.width = width;
context.canvas.height = height;
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
@roovo
roovo / fulcrum-jasmine-firefox-bfb78b164
Created September 8, 2011 06:56
the output wot I got
86 specs, 3 failures in 0.628sFinished at Thu Sep 08 2011 07:44:01 GMT+0100 (BST)
runStoryCollection collection
runposition
runshould return stories in position order
runshould move between 2 other stories
runshould move after another story
runshould move after the last story
runshould move before the first story
runshould move before another story
runshould return the story after a given story
@roovo
roovo / coverage.rake
Created December 13, 2010 12:38
for generating coverage with rspec 2 in ruby 1.9.2 using Simplecov
Rake.application.instance_variable_get('@tasks').delete('spec:rcov')
module SimpleCov
class RakeTask < ::Rake::TaskLib
def initialize(*args)
desc "Run RSpec code examples"
task(args.shift || :simplecov) do
RakeFileUtils.send(:verbose, true) do
if files_to_run.empty?
require 'rubygems'
require 'dm-core'
class User
include DataMapper::Resource
property :id, Serial
end
class Paper