This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "BBEdit" | |
set _sel to the selection | |
set _lines to lines in selection | |
set tasks_added to {} | |
repeat with _line in _lines | |
if length of _line is not 0 then | |
my makeOFTask(_line as text) | |
set end of tasks_added to _line as text | |
end if | |
end repeat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# so the lib can be found when the test is run | |
export LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH | |
# alternatively put the .so generated after running make someplace where the system will find it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait RangedNum<T>: Num { | |
pub fn min() -> Self; | |
pub fn max() -> Self; | |
pub fn new(x: T) -> Self; | |
pub fn set(&mut self, x: T); | |
pub fn get(&self) -> T; | |
pub fn normalize(&self) -> Self; | |
pub fn normalize_self(&mut self); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# Brett Terpstra 2013, WTF license <http://www.wtfpl.net/txt/copying/> | |
# Outputs a vertical bar chart from date-based JSON data | |
# Requires the JSON rubygem: `[sudo] gem install json` | |
require 'date' | |
require 'open-uri' | |
require 'rubygems' | |
require 'json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// F#'s "pipe-forward" |> operator | |
// | |
// Also "Optional-chaining" operators |>! and |>& | |
// | |
// And adapters for standard library map/filter/sorted | |
infix operator |> { precedence 50 associativity left } | |
infix operator |>! { precedence 50 associativity left } | |
infix operator |>& { precedence 50 associativity left } | |
infix operator |>* { precedence 50 associativity left } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// returns a random color | |
func randomColor() -> UIColor{ | |
let red = CGFloat(drand48()) | |
let green = CGFloat(drand48()) | |
let blue = CGFloat(drand48()) | |
return UIColor(red: red, green: green, blue: blue, alpha: 1.0) | |
} |