Skip to content

Instantly share code, notes, and snippets.

@sintaxi
sintaxi / hosting-an-event-on-surge.md
Last active Dec 8, 2017
Instructions for hosting an event on surge.sh
View hosting-an-event-on-surge.md

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...
View harp
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 Nov 20, 2015
Issues with my recent Asus X99 build.
View boot-issue.md

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 Oct 20, 2015
Example surge CLI integration
View cli.js
/**
* Surge Integration
*/
var surge = require('surge')({ platform: "harpjs.com" })
var hooks = {
postProject: function(req, next){
View gist:afff3fc849abfcd4cdc9
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 Jun 24, 2015
compile harp project using NodeJS
View gist:4a2ba0ee6d843748cd5d
var harp = require("harp")
harp.compile("source", "www", function(errors, output){
console.log(output)
})
View gist:249c4e1d15ff526e2570
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
[...]
-----END RSA PRIVATE KEY-----
@sintaxi
sintaxi / gist:26924fc02788fa6e4075
Created Apr 27, 2015
check to see if cert used key.
View gist:26924fc02788fa6e4075
(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 Aug 29, 2015
surge library interface
View surge.js
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")
})
View gist:bcec8a3f28533a139b3c
Surge Analytics
Free Tier
- number of visits
- device type breakdown (desktop/tablet/phone/etc)
- status code breakdown (200/206/404/304/etc)
- page visits breakdown (number of requests to most popular endpoints)
You can’t perform that action at this time.