Skip to content

Instantly share code, notes, and snippets.

View sintaxi's full-sized avatar
🔥
GSD

Brock Whitten sintaxi

🔥
GSD
View GitHub Profile
@sintaxi
sintaxi / webhook.md
Created May 13, 2016 14:49
webhook for surge

Example of a webhook server:

var http = require('http')
var express    = require('express')
var bodyParser = require('body-parser')

var app = express()

// parses application/json
@sintaxi
sintaxi / hosting-an-event-on-surge.md
Last active December 8, 2017 17:29
Instructions for hosting an event on surge.sh

Hosting a competition on surge.sh

...by adding an EVENT.json file to the root of your project.

Hosting an event on surge is very simple. It's three easy steps.

  1. Publish a project to Surge to your root domain (eg. surge ./myproject superevent.io)
  2. Point superevent.io and *.superevent.io DNS records to surges servers.
  3. Add EVENT.json file with the following properties...
@sintaxi
sintaxi / harp
Created December 16, 2015 09:47
Harp - Web Publishing Service (v1.0)
Usage: harp <dir> [domain]
Commands:
harp <dir> Starts development server on project directory
harp <dir> <domain> Deploys project directory to the web
harp <dir> <dir> Compiles project directory to other directory
@sintaxi
sintaxi / boot-issue.md
Last active November 20, 2015 11:21
Issues with my recent Asus X99 build.

Expectation

  • To be able to boot/install operating system's on my X99 build.

Reality

  • Installing any operating system causes the machine to freeze.

Facts

@sintaxi
sintaxi / cli.js
Last active October 20, 2015 00:09
Example surge CLI integration
/**
* Surge Integration
*/
var surge = require('surge')({ platform: "harpjs.com" })
var hooks = {
postProject: function(req, next){
var m = React.createElement
var Header = React.createClass({
role: 'Header',
render: function(){
return m("header", { role:"banner" },
m("div", { id: "cd-logo" },
m("a", {},
m("img", { src: "img/cd-logo.svg", alt: "Logo" })
@sintaxi
sintaxi / gist:4a2ba0ee6d843748cd5d
Created June 24, 2015 20:20
compile harp project using NodeJS
var harp = require("harp")
harp.compile("source", "www", function(errors, output){
console.log(output)
})
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
[...]
-----END RSA PRIVATE KEY-----
@sintaxi
sintaxi / gist:26924fc02788fa6e4075
Created April 27, 2015 05:08
check to see if cert used key.
(openssl x509 -noout -modulus -in my.crt | openssl md5 ; openssl rsa -noout -modulus -in my.key | openssl md5) | uniq
@sintaxi
sintaxi / surge.js
Last active August 29, 2015 14:18
surge library interface
var surge = require("surge")
var readableStream = surge.createReadableStream("path/to/project")
surge.publish(readableStream, { domain: "foobar.com", email: "brock@sintaxi.com", password: "bigsecret" }, function(errors, deployment){
if (errors) return "invalid arguments. cant deploy."
deployment.on("error", function(err){
console.log("Oops! something went wrong")
})