Skip to content

Instantly share code, notes, and snippets.

View osxpeppermint's full-sized avatar

Peppermint - Code Editor for Mac osxpeppermint

View GitHub Profile
@osxpeppermint
osxpeppermint / HaxeLinter.js
Created June 20, 2015 10:10
HaxeLinter - Peppermint $Builtin (in JavaScript)
var HaxeLinter,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
HaxeLinter = (function(superClass) {
extend(HaxeLinter, superClass);
function HaxeLinter() {
return HaxeLinter.__super__.constructor.apply(this, arguments);
}
@osxpeppermint
osxpeppermint / HaxeLinter.coffee
Created June 20, 2015 10:06
HaxeLinter - Peppermint $Builtin (in CoffeeScript)
class HaxeLinter extends $Builtin
init:->
@startRun(1000);
run:->
doc = $Document.temp($Editor.content(),"hx","HaxeLinter");
$Terminal.execBg("haxe","--cwd", doc.folder, doc.filename, "--no-output",
@osxpeppermint
osxpeppermint / HaxeScraper.hx
Created June 2, 2015 11:06
OpenFL library scraper
import sys.FileSystem;
import sys.io.File;
class Scraper {
static public function scrapeFile(name,filename):Void {
var r = ~/public\s(?:inline\s)?function\s([A-Za-z]+)/gm;
var fileContents = sys.io.File.getContent(filename);
var fileLines = fileContents.split("\n");
@osxpeppermint
osxpeppermint / script.coffee
Created May 31, 2015 10:26
Go->Run (updated)
class GoRun extends $Plugin
run:->
path = $Document.info("go").path;
$Terminal.exec("go", "run", path,
(result)=>
if result.indexOf("No such file or directory") > -1
$Dialog.alert("Compiler not found","To execute Go code, the Go compiler must be installed");