Skip to content

Instantly share code, notes, and snippets.

View nethoncho's full-sized avatar
🍊

Net Honcho nethoncho

🍊
View GitHub Profile
@nethoncho
nethoncho / button_driver.h
Created July 21, 2014 14:12 — forked from mweyland/button_driver.h
xmos button driver
#ifndef BUTTON_DRIVER_H_
#define BUTTON_DRIVER_H_
interface button_interface
{
void pressed(void);
};
void button_driver(in port button_port, client interface button_interface button_interface);
@nethoncho
nethoncho / debounceExample.js
Last active August 29, 2015 14:15
angular debounce example
// Example from https://scotch.io/tutorials/making-skinny-angularjs-controllers
// Search the goat database
$scope.searchGoats = _.debounce(function(query) {
$http.get('/goats/search/' + query)
.then(function(response) {
$scope.goats = response.data;
});
}, 300);
"use strict";
exports.queryAll = function(conn, sql, args, cb) {
var allRows = [];
conn.execute(sql, args, {
resultSet: true
}, function(err, result) {
if (err) return cb(err);
function fetch() {
/*
* letsencrypt certificates with node js express / http
* key is obvious, privkey.pem
* ca and cert were not obvious to me.
* ca uses chain.pem
* cert uses fullchain.pem
*
* You can test your project with https://www.ssllabs.com/ssltest/
*
*/
@nethoncho
nethoncho / ! pg-migrate-demo
Last active October 25, 2017 03:27
Postgresql database migration management
# https://github.com/salsita/node-pg-migrate
npm install node-pg-migrate
@nethoncho
nethoncho / ! Ubuntu nginx meteor proxy
Last active October 27, 2017 04:18
Meteor nginx application proxy on Ubuntu 16.04.3 LTS
# Use sudo before each command if not logged in as root
#
# Install nginx https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04
apt-get update
apt-get install nginx
# Check that HTTP port 80 and HTTPS port 443 are open
ufw app status
# Make sure nginx starts on boot
/*
* config/bootstrap.js
* Example of how to redirect all http request to https
* See http://jsbot.io/node/http-and-https-handle-with-sailsjs
*
*/
module.exports.bootstrap = function(cb) {
var express = require("express")
var app = express();
@nethoncho
nethoncho / LICENSE
Last active December 20, 2017 14:52 — forked from rkirsling/LICENSE
Trend Chart (Area + Line)
Copyright (c) 2014 Ross Kirsling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@nethoncho
nethoncho / README.md
Created December 26, 2017 14:28 — forked from brattonc/README.md
D3 Liquid Fill Gauge

Liquid Fill Gauge v1.1 - 7/14/2015

Changes:

  • Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.

Configurable features include:

  • Changeable min/max values.
  • All colors.
@nethoncho
nethoncho / README.md
Created March 22, 2018 09:07 — forked from ErisDS/README.md
Deployment tools for Ghost themes

Gulp tools to deploy a Ghost theme

To set it up:

  • copy gulp-config.json.example to gulp-config.json
  • enter the blog admin url, no trailing slash, e.g. https://myblog.ghost.io
  • grab the client secret for the frontend from the source of any page of the blog
  • enter the email address & password you use to login to the blog (must be administrator-level)

To deploy: