Skip to content

Instantly share code, notes, and snippets.

View ashleyconnor's full-sized avatar
🏠
Working from home

Ashley Connor ashleyconnor

🏠
Working from home
View GitHub Profile
@ashleyconnor
ashleyconnor / processify.py
Created December 4, 2018 19:51 — forked from schlamar/processify.py
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value
// deps
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "next",
"react-router-redux": "next",
"redux": "^3.6.0",
"redux-logger": "^2.8.1"
// index.js
@ashleyconnor
ashleyconnor / react-router-component.js
Created January 5, 2017 02:50
Testing component that uses react-router props
/// Route
import React from 'react';
import { Router, Route } from 'react-router';
import Profile from './components/Profile';
const Routes = (props) => (
<Router {...props}>
<Route path="/profile/:username" component={Profile} />
@ashleyconnor
ashleyconnor / async-await.js
Created December 4, 2016 14:56
async/await example
async function main () {
try {
const res = await fetch('https://api.github.com/orgs/facebook');
const json = await res.json();
console.log(json);
} catch (e) {
// handle error
}
}
Server listening on :: port 33333.
debug3: fd 5 is not O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug3: send_rexec_state: entering fd = 8 config len 760
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
debug1: inetd sockets after dupping: 3, 3
Connection from 99.254.XXX.XXX port 56834 on 158.69.75.XXX port 33333
debug1: Client protocol version 2.0; client software version Go
@ashleyconnor
ashleyconnor / output.sh
Created July 24, 2016 20:29
Output from gitlab > dokku push
$ git push [email protected]:phoenix master
Warning: Permanently added the ECDSA host key for IP address '8.8.8.8' to the list of known hosts.
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
@ashleyconnor
ashleyconnor / Berksfile
Created August 8, 2015 05:27
Vagrantfile for Berkshelf and Chef Zero
source "https://supermarket.chef.io"
cookbook 'apt', '~> 2.7.0'
cookbook 'build-essential', '~> 2.2.3'
cookbook 'git', '~> 4.3.3'
cookbook 'heroku-toolbelt', '~> 0.1.0'
cookbook 'imagemagick', '~> 0.2.3'
cookbook 'nginx', '~> 2.7.6'
cookbook 'nodejs', '~> 2.4.0'
cookbook 'postgresql', '~> 3.4.20'
input {
tcp { port => 3333 type => "json" }
stdin {
type => "stdin-type"
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
@ashleyconnor
ashleyconnor / logstash.conf
Last active August 29, 2015 14:19
Example logstash config
input {
tcp { port => 3333 type => "json event" codec => json_lines {} }
stdin {
type => "stdin-type"
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
#!/bin/sh
# init.d script for basexserver http://basex.org/
# (c) 2012 Andy Bunce <[email protected]>, BSD
# (c) 2015 Ashley Connor <[email protected]>, LICENSE AS ABOVE
### BEGIN INIT INFO
# Provides: basex-server
# Required-Start: $syslog
# Required-Stop: $syslog