Skip to content

Instantly share code, notes, and snippets.

View compressed's full-sized avatar

compressed

  • Frostly LLC ❅
  • Boston, MA
View GitHub Profile
@compressed
compressed / syntax_highlighting.py
Created January 27, 2012 11:10 — forked from lporras/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """
def on_load(self, view):
filename = view.file_name()
@compressed
compressed / sma.jl
Last active August 29, 2015 14:10 — forked from IainNZ/sma.jl
function sma_original(avect, numPer)
numEle = length(avect)
tout = Array(Float32, numEle)
for ndx = 1:numEle
tsum = 0.0
begndx = max(1, ndx - numPer)
for slicendx = begndx:ndx
tsum += avect[slicendx]
end
tout[ndx] = tsum / float32(numPer)
@compressed
compressed / playground.rs
Created February 1, 2016 15:08 — forked from anonymous/playground.rs
rust: map + filter_map + Result examples
use std::collections::HashMap;
fn main() {
// println!("{:?}", go(&[1, 2, 3]));
// println!("{:?}", go(&[1, 3, 4, 5, 6]));
println!("go_while {:?}", go_while(&[1, 3, -4, 4, 5, 6]));
println!("go_filter_map {:?}", go_filter_map(&[1, 3, 4, -4, 5, 6]));
let mut hm = HashMap::new();