Skip to content

Instantly share code, notes, and snippets.

drmikecrowe

Block or report user

Report or block drmikecrowe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@drmikecrowe
drmikecrowe / info.md
Created Jan 24, 2018
Linux Mint 18.3 Cinnamon desktop debug info
View info.md

$ cat /etc/lsb-release

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=sylvia
DISTRIB_DESCRIPTION="Linux Mint 18.3 Sylvia"

$ ps faux | grep cinnamon

mcrowe    1811  0.0  0.0 438712 22488 ?        Ssl  05:55   0:01      \_ cinnamon-session --session cinnamon
@drmikecrowe
drmikecrowe / setup.js
Created Jan 19, 2016
Set debug log level for MongoClient
View setup.js
var MongoClient = require('mongodb').MongoClient
, Logger = require('mongodb').Logger;
Logger.setLevel('debug');
View key-installs.sh
set -e
set -x
sudo apt-get update
sudo apt install git python2.7 build-essential python-virtualenv python-pip python-dev libcurl4-gnutls-dev libgnutls28-dev mysql-client awscli phantomjs
# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=stable
# Update the apt package index.
@drmikecrowe
drmikecrowe / embed.js
Last active Jan 1, 2019
Embedding factualsearch.news in your website
View embed.js
<script>
(function() {
var cx = '011275290256739755566:cwfn9qhuqkk';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
@drmikecrowe
drmikecrowe / template.sh
Last active Jan 15, 2019
Bash Template
View template.sh
#!/usr/bin/env bash
function mainScript() {
debug "Arguments: $args"
}
# Options and Usage
# -----------------------------------
function usage() {
@drmikecrowe
drmikecrowe / DisableAllMethods.js
Last active Sep 5, 2019
Loopback mixin to disable or expose methods
View DisableAllMethods.js
// based on https://github.com/strongloop/loopback/issues/651#issuecomment-259540469
'use strict';
const
relationMethodPrefixes = [
'prototype.__findById__',
'prototype.__destroyById__',
'prototype.__updateById__',
'prototype.__exists__',
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@drmikecrowe
drmikecrowe / machine.js
Last active Nov 21, 2019
initializeMachine.js
View machine.js
const RETRY_INTERVAL = 2000;
const MAX_RETRIES = 3;
const initHardwareState = "initHardware";
const connectNetworkState = "connectNetwork";
const provisionState = "provision";
const retryState = "retry";
const fatalState = "fatal";
const connectedState = "connected";
You can’t perform that action at this time.