Skip to content

Instantly share code, notes, and snippets.

@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"
@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)
# 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 / fast.elm
Created October 30, 2016 09:37
elm compile speed comparison
module Main exposing (..)
type BoardId
= ZeroZero
| ZeroOne
| ZeroTwo
| OneZero
| OneOne
| OneTwo
module Main exposing (..)
import Date exposing (Month(..))
compareMonth : Month -> Month -> Order
compareMonth m1 m2 =
case m1 of
Jan ->
case m2 of
@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
@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
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index bafe23e..c01717a 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -230,11 +230,6 @@
// Tell the compiler to link to either panic_abort or panic_unwind
#![needs_panic_runtime]
-// Always use alloc_system during stage0 since we don't know if the alloc_*
-// crate the stage0 compiler will pick by default is available (most
@Ryan1729
Ryan1729 / multi-selection.diff
Created November 13, 2017 06:42
diff against geany/geany @ dd58ab6
diff --git a/src/editor.c b/src/editor.c
index 460c832a..0cee854c 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -315,15 +315,7 @@ static gboolean on_editor_button_press_event(GtkWidget *widget, GdkEventButton *
}
if (event->type == GDK_BUTTON_PRESS && state == GEANY_PRIMARY_MOD_MASK)
{
- sci_set_current_position(editor->sci, editor_info.click_pos, FALSE);
-
@Ryan1729
Ryan1729 / Add Alacritty to Context Menu.reg
Created November 25, 2018 22:46
A .reg file adding a call to a command, (in this case alacritty.exe) to the windows explorer context menu and passing it the current directory
Windows Registry Editor Version 5.00
; created by Ryan Wiedemann
;
; right-clicking directly on a directory
;
[HKEY_CLASSES_ROOT\Directory\shell\alacrittymenu]
@="Open Alacritty Here"