Skip to content

Instantly share code, notes, and snippets.

@Ryan1729
Ryan1729 / bisect.sh
Last active September 23, 2017 22:52
a script meant to be run with `git bisect run` on rust-lang/rust
python ./x.py build --stage 1 src/libtest
cd ..
export RUSTC="/home/ryan/lib_reloading_bisect/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc"
cd ./tiny-live-code-example/
echo $RUSTC
@Ryan1729
Ryan1729 / flatten.rb
Created August 26, 2017 02:28
My own implementation of Array#flatten
module Flatten
def flatten(array)
result = []
array.each do |element|
if element.is_a? Array
flatten(element).each { |inner_element| result.push(inner_element) }
else
result.push(element)
end
module Main exposing (..)
import Date exposing (Month(..))
compareMonth : Month -> Month -> Order
compareMonth m1 m2 =
case m1 of
Jan ->
case m2 of
@Ryan1729
Ryan1729 / fast.elm
Created October 30, 2016 09:37
elm compile speed comparison
module Main exposing (..)
type BoardId
= ZeroZero
| ZeroOne
| ZeroTwo
| OneZero
| OneOne
| OneTwo
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@Ryan1729
Ryan1729 / benchmark.elm
Created June 5, 2016 05:46
Simple benchmark for elm-webgl based on the cube example
module Main exposing (..)
import Color exposing (..)
import Math.Vector3 exposing (..)
import Math.Matrix4 exposing (..)
import WebGL exposing (..)
import Html.App as Html
import AnimationFrame
import Html.Attributes exposing (width, height)
import Debug exposing (log)
@Ryan1729
Ryan1729 / dependanciesTGF.lua
Created April 7, 2016 20:35
get local, (non library) lua dependencies in tgf
-- this creates a Trivial Graph Format representaion of the
-- require-based dependancies of the lua files in the current directory,
-- then saves it to <containing folder name>_deps.tgf
-- run in the directory you want to graph like this:
-- lua dependanciesTGF.lua
--requires Penlight
local file = require "pl.file"