View Main.elm
-- CO: https://ellie-app.com/3YJ65RSsjGRa1/1
module Main exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Html exposing (..)
import Json.Decode as Decode
import Time exposing (Time)
View Main.elm
-- https://ellie-app.com/3XKKySvspDka1/0
module Main exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Html exposing (..)
import Json.Decode as Decode
import Task
import Time
View ext.elm
module Main exposing (..)
import Html exposing (Html, text)
type alias Named a = { a | name : String }
foo : Compound -> String
foo named = named.name ++ "!"
type alias Position r = { r | x:Float }
View elm_sprockets.rb
# Elm integration for Sprockets 3.x (Rails 4.2)
#
# Revised version of a Sprockets 3.x processor for Elm. It supports
# dependencies. One little quirk is that only .js.elm files are
# requireable in application.js.
#
# How to use it?
#
# Put this file in your config/initializers/ and create
# app/assets/javascripts/MyModule.js.elm and require it in your
View gist:3344bea37b0844915693d75826705586
#!/usr/bin/env stack
{- stack runghc
--resolver lts-7
--install-ghc
--package QuickCheck
--package checkers
-}
-- CO: https://www.reddit.com/r/HaskellBook/comments/5p2aka/tip_for_quickchecking_typeclass_instances/
View fizzbuzz.hs
fizz :: Integer -> String
fizz n = if ((n `mod` 3) == 0)
then "fizz"
else ""
buzz :: Integer -> String
buzz n = if ((n `mod` 5) == 0)
then "buzz"
else ""
View demo.vim
" http://andrewvos.com/writing-async-jobs-in-vim-8
function! BackgroundCommandClose(channel)
execute "cfile! " . g:backgroundCommandOutput
copen
unlet g:backgroundCommandOutput
endfunction
function! RunBackgroundCommand(command)
if !exists('g:backgroundCommandOutput')
View gist:8dc54cbc95ded2b52a61bf9405b2d52b
git clone git@github.com:vim/vim.git ~/vim
sudo apt-get remove vim
cd ~/vim
sudo make distclean
./configure --with-features=huge\
--enable-multibyte\
--enable-rubyinterp=yes
--enable-pythoninterp=yes
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu #non-standard!
--enable-python3interp=yes
View list-comprehension-equivalent.js
// equivalent haskell using list comprehension syntax
// [x^2 | x <- [1..10], rem x 2 == 0]
var list = [];
// no ranges ...
for (var i = 1; i < 11; i += 1) {
list.push(i);
}
View sticky_grid.rb
board = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
while (input = gets.chomp.to_i) != "exit"
board = board.map.with_index do |row, i|
row.map.with_index do |column, ii|
if column == input
"x"