Skip to content

Instantly share code, notes, and snippets.

View sophistifunk's full-sized avatar

Josh McDonald sophistifunk

  • Expantra
  • Brisbane, Australia
View GitHub Profile
#! /usr/local/bin/node
// ---[ Dependencies ]------------------------------------------------------------------------------
var dgram = require("dgram");
var mdns = require("mdns");
// ---[ Config ]------------------------------------------------------------------------------------
var mdnsTimeout = 20000; // ms
### snipped OS noise and work-related hosts :)
# Cocksuckers that mess with your copy + paste, and other such obscenities
0.0.0.0 www.tynt.com
0.0.0.0 tynt.com
# Evil jerks with never-ending "top X" lists / "more from around the web" / etc
0.0.0.0 zergnet.com
0.0.0.0 www.zergnet.com
0.0.0.0 taboola.com
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="customValue" type="xs:string" />
</xs:schema>
<application
xmlns="http://ns.adobe.com/air/application/20.0"
xmlns:cv="https://gist.githubusercontent.com/sophistifunk/85142f51cb7f4d607074/raw/27adac43b9f2c528af89e3bd672c85bbbf5a4f9b/customvalue.xsd">
<id>com.application.id</id>
<filename>Test</filename>
<name>Test App</name>
<versionNumber>0.0.1</versionNumber>
<cv:customValue>value</cv:customValue>
// All you needed to do if you wanted codegen:
[Bindable]
public var easyProp:MyClass;
// More explicit version using a named event:
private var _myProp:MyClass;
[Bindable("myPropChange")]
public function get myProp():MyClass
{
import React, {Component} from 'react';
function Alpha(props) {
console.log("Alpha props.className", props.className);
return <strong className="onStrong">Alpha</strong>;
}
function Bravo(props) {
console.log("Bravo props.className", props.className);
return <Alpha className="san"/>;
//From This:
<Route path={rootRoutePath} component={OrganisationPipelines}>
<IndexRoute component={Pipelines}/>
<Route path=":pipeline/branches" component={MultiBranch}/>
<Route path=":pipeline/activity" component={Activity}/>
<Route path=":pipeline/pr" component={PullRequests}/>
</Route>
//To this:
// Old
var docHead = exports.getHeadElement();
var rootURL = getAttribute(docHead, "data-rooturl");
if (!rootURL) {
throw "Attribute 'data-rooturl' not defined on the document <head> element.";
}
// New
var docHead = exports.getHeadElement();
var rootURL = getAttribute(docHead, "data-rooturl");
@sophistifunk
sophistifunk / pre-publish.js
Created June 6, 2016 23:54
Pre-publish POC to block "npm publish" from command line
"use strict";
const npm_config_argv = process.env.npm_config_argv;
if (!npm_config_argv) {
console.error("This script should only be run via npm trigger -- npm_config_argv not found in ENV");
process.exit(1);
}
let isInstall = false;
// Pipeline
export type PipelineInfo = {
pipelineMetadata: any
}
// Stages
export type StageInfo = {
name: string,
uid: string,
pipelineMetadata: any