Skip to content

Instantly share code, notes, and snippets.

@ellemenno
ellemenno / Type Check.md
Last active December 21, 2015 20:38
trying to understand `as`, `is`, `typeof`, `instanceof` in Loomscript

Testing type reflection in Loom

(results below)

TypeChecker.ls

package
{
    import loom.Application;
@ellemenno
ellemenno / Type Operators.md
Last active December 22, 2015 13:09
Comparing type operator results in Loom on function args vs. literal values

Testing type ops in Loom

is, as, instanceof return expected results on literal values, but not when the same values are passed into a function and the type ops are applied to the function argument variables. NOTE: when testing with trace() be aware that Sprint 30 (and earlier?) contained a bug that caused trace to print all Booleans as true. This is resolved in SDK v1.1.2738 (and Sprint 31).

(results below)

TypeChecker.ls

@ellemenno
ellemenno / TinyLsTest.md
Last active December 22, 2015 19:18
testing out TinyLS
@ellemenno
ellemenno / Feathers Font Quads.md
Last active December 24, 2015 20:38
screenshots of the Loom FeathersExample on Android, iOS, and OS X

trouble with font quads in sprint31 on Android 4.1.2 (regression from sprint30)

screenshot images below

@ellemenno
ellemenno / spinner.rb
Created March 11, 2014 16:41
ascii spinner
#!/usr/bin/env ruby
# encoding: UTF-8
@dot_cycle = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷']
#braille random: 0x2800 - 0x28ff
@z_arrow = ['←','↖','↑','↗','→','↘','↓','↙']
@z_b = ['b','ᓂ','q','ᓄ']
@z_d = ['d','ᓇ','p','ᓀ']
@ellemenno
ellemenno / .profile
Last active June 6, 2021 21:54
The little tweaks I've accumulated and grown accustomed to.
# prompt (see https://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html)
# this prompt has 3 parts:
# 1. exit code indicator. test $? and print green ○ (U+25CB) for success (0), or red ● (U+25CF) for fail (non-zero)
# 2. current working directory. print \W in bold
# 3. UID indicator. \$ gives # for root, $ otherwise; print in bold
export PS1="\$([ \$? = 0 ] && echo '\[\e[32m\]○\[\e[0m\]' || echo '\[\e[31m\]●\[\e[0m\]') \[\e[1m\]\W \$ \[\e[0m\]"
# aliases (use `alias` to list)
alias ls="ls -hF"
alias l="ls -1"
@ellemenno
ellemenno / Rakefile
Created April 7, 2014 01:06
basic rake task for gem's spec/test execution
require 'rake'
require 'rake/testtask'
Rake::TestTask.new do |t|
t.pattern = 'spec/**/*_spec.rb'
t.libs.push 'spec'
end
@ellemenno
ellemenno / commandprompt.bat
Last active August 29, 2015 14:01
DOS environment tweaks for Command Prompt Portable
@echo off
color 70
prompt $p$g$s
title Command Prompt Portable
set PA=%USERPROFILE%\PortableApps\PortableApps
set USERLOCAL=%PA%\CommandPromptPortable\Data
set PATH=%PATH%;%USERLOCAL%\bin
@ellemenno
ellemenno / tree
Last active July 22, 2017 18:16
Directory tree printer
#!/usr/bin/env ruby
# encoding: utf-8
@bar = '─'
@elbow = '└'
@pipe = '│'
@space = ' '
@tee = '├'
@slash = '/'
@ellemenno
ellemenno / title_func.sh
Last active September 7, 2015 19:47
Set shell title
# set the title of the current Terminal tab
function title {
printf "\033]0;%s\007" "$1"
}