Skip to content

Instantly share code, notes, and snippets.

{
"sublimelinter_delay": 1,
"sublimelinter_fill_outlines": false,
"sublimelinter_gutter_marks": true,
"sublimelinter_popup_errors_on_save": true,
"javascript_linter": "jshint",
// jshint: options for linting JavaScript. See http://jshint.com/#docs for more info.
{
"sublimelinter_delay": 1,
"sublimelinter_fill_outlines": false,
"sublimelinter_gutter_marks": true,
"sublimelinter_popup_errors_on_save": true,
"javascript_linter": "jshint",
// jshint: options for linting JavaScript. See http://jshint.com/#docs for more info.
/*globals MySystem rules nodes suggestions*/
// returns uuids for energytypes or 'unidenitfied_type'
var linkTypes = function(node,linkTypes) {
  var links = node.get(linkTypes);
  return links.map( function (link) {
    return link.get('energyType') || 'unidenitfied_type';
  });
};
@knowuh
knowuh / transform.js
Created March 22, 2012 15:53
Transformation rule snippet
/*globals MySystem rules nodes suggestions*/
// returns uuids for energytypes or 'unidenitfied_type'
var linkTypes = function(node,linkTypes) {
var links = node.get(linkTypes);
return links.map( function (link) {
return link.get('energyType') || 'unidenitfied_type';
});
};
sun_choloro = should_have.node('sun').link('light').node('choloroplast')
sun_plant = should_have.node('sun').link('light').node('plant').link('light').node('chloroplast')
chemical_sun = should_not_have.node('sun').link('chemical').feedback('the sun doesn't emit chemicals')
requirements << AndRule
'your diagram has problems'
chemical_sun
OrRule
'how does the plant get energy'
Rule.node('sun').link('light').node('choloroplast').feedback('how does the plant get energy'),
@knowuh
knowuh / rlogparser.rb
Created March 8, 2012 21:10
Parses rails logs, and tries to 'guess' the current user for various requests
@loginfile = "rites.log"
#
# Parses rails logs, and tries to 'guess' the current user for various requests based on
# context (file position) and IP address. Its probably wrong quite often.
# assumes that some of the rails logs lines match this general format:
#
# Processing SessionsController#create (for 158.123.187.120 at 2012-03-02 15:46:33) [POST]
# Parameters: {"action"=>"create", "controller"=>"sessions", "login"=>"cdibiasio", "password"=>"[FILTERED]"}
# Failed login for 'cdibiasio' from 158.123.187.120 at Fri Mar 02 20:46:33 UTC 2012
@knowuh
knowuh / CoffeeScript.sublime-build
Created February 24, 2012 22:23
coffeescript build file for sublime text
// place this in
// ~/Library/Application Support/Sublime Text 2/Packages/coffee-script-tmbundle/Commands/CoffeeScript.sublime-build
{
"path": "$HOME/bin:/usr/local/bin:$PATH",
"cmd": ["coffee","-c","$file"],
// "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
// SyntaxError: In (filepath), unmatched ] on line 151
"file_regex": "^.*In (.*), .* ([0-9]*)$",
"selector": "source.coffee"
}
bash-3.2$ python -m SimpleHTTPServer 8000 & dns-sd -R "lab" _http._tcp "" 8000
[1] 59972
Registering Service lab._http._tcp port 8000
Serving HTTP on 0.0.0.0 port 8000 ...
14:37:16.896 Got a reply for service lab._http._tcp.78905693.members.btmm.icloud.com.: Name now registered and active
14:37:17.167 Got a reply for service lab._http._tcp.local.: Name now registered and active
require("../../env");
require("d3");
components = require("../../../lab/lab.components");
var vows = require("vows"),
assert = require("assert");
var suite = vows.describe("lab.components");
suite.addBatch({
:executing "cd /web/portal/releases/20120114162030 && #<Capistrano::Configuration::Namespaces::Namespace:0x10243d098> RAILS_ENV=production db:migrate"
servers: ["ruby-vm5.concord.org"]
[ruby-vm5.concord.org] executing command
** [out :: ruby-vm5.concord.org] sh: -c: line 1: syntax error: unexpected end of file
command finished in 244ms