Skip to content

Instantly share code, notes, and snippets.

@eisisig
eisisig / stash_slack.sh
Last active September 7, 2015 17:01 — forked from linjer/stash_slack.sh
Atlassian Stash 3.2 Git integration with Slack through external web hooks
#!/bin/bash
# $1 => Slack hook URL
# $2 => Channel name
# $3 => URL to web repo browser for base project
slack_url="$1"
channel="$2"
browser_url="$3"
# Debugging output in /tmp/stash_slack.txt
@eisisig
eisisig / stash-webhook-to-slack.js
Last active September 7, 2015 17:02 — forked from sirkirby/stash-webhook-to-slack.js
process a stash webhook and post to slack
var issues;
exports.post = function(request, response) {
var rep = request.body.repository;
var ref = request.body.refChanges;
var ch = request.body.changesets;
// let me specify the destination and noise level via the query string
var channel = "#devops";
if (request.query.channel != undefined && request.query.channel != null)
@eisisig
eisisig / np.sh
Created October 7, 2015 23:49 — forked from stevemao/np.sh
Publish node module
# npm publish with goodies
# prerequisites:
# `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json`
# `np` with optional argument `patch`/`minor`/`major`/`<version>`
# defaults to conventional-recommended-bump
# and optional argument preset `angular`/ `jquery` ...
# defaults to conventional-commits-detector
np() {
travis status --no-interactive &&
trash node_modules &>/dev/null;
@eisisig
eisisig / iisconfig.xml
Created October 27, 2015 17:02 — forked from jdmonty/iisconfig.xml
IIS html5 mode/pushState
<!-- https://coderwall.com/p/mycbiq -->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
@eisisig
eisisig / Enhance.js
Created November 23, 2015 13:08 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@eisisig
eisisig / local-npm.md
Created January 17, 2016 14:55 — forked from nolanlawson/local-npm.md
Setting up local-npm as a launch daemon on OS X

Setting up local-npm as a launch daemon on OS X

These instructions will set up local-npm so that it runs as a launch daemon, meaning that it will start up whenever you log in.

First, install local-npm and pm2:

npm install -g local-npm
npm install -g pm2

Shipit Deploy

Shipit is a pretty awesome universal automation and deployment tool written in JavaScript.

Setup your server

(this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g pm2

Install shipit

  • npm install -g shipit-cli
@eisisig
eisisig / README:Rollup.md
Created February 3, 2016 09:56
Standard Configs to use with Rollup.js

Rollup Configs

If you haven't used or heard of Rollup it is an awesome bundling system that allows you to leverage es2015 modules and produce backwards compatible libraries.

Here are a few configs to help you bundle your apps.

@eisisig
eisisig / gist:032a7c6cea24299d3c7e
Created February 11, 2016 15:10 — forked from ianbattersby/gist:4641450
Ubuntu TeamCity agent setup
#!/bin/bash
# THESE ARE NOTES, NOT TESTED AS SCRIPT!
# We need the following to get and run teamcity agent
sudo apt-get install openjdk-7-jre-headless
sudo apt-get install unzip #For unzipping buildAgent.zip
# For compiling Simple.Web
sudo apt-get install ruby1.9.1
// from the brilliant mind of sb
var _catch = Promise.prototype.catch;
Promise.prototype.catch = function () {
return _catch.call(this, function (err) { setTimeout(function () { throw(err); }, 0); });
}