Skip to content

Instantly share code, notes, and snippets.

View mallond's full-sized avatar
:electron:
-.- .--- --... -.- --. ---

David Mallon ⚙ mallond

:electron:
-.- .--- --... -.- --. ---
View GitHub Profile
@mallond
mallond / linux_shell_commands
Last active March 12, 2018 16:34
Got Linux - shell commands
##########
# File Transfer
##########
# Copy files through ssh
scp deployer@fake-server:/var/log/mongodb/mongod.log.2.gz /Users/name/Documents/temp/logs/
# Copy a file from your workstation to a server behind a bastion host
scp -oProxyCommand="ssh -AW %h:%p bastion_user@bastion_ip" file_destination user@destination_IP:/path
scp -oProxyCommand="ssh -AW %h:%p ubuntu@bastion-production" dockerengine_install.sh ubuntu@fake-server:/home/ubuntu/
@mallond
mallond / gist:085ce0e463f2a52ad5d36b8eff36d443
Created November 16, 2017 14:26 — forked from emmajane/gist:59321345a81a4f5837c0
JQL Syntax for the Impatient

JQL Syntax for the Impatient

There are a few JQL syntax bits to get you started:

  • AND --- allows you to add qualifiers to a list
  • != Thing --- target one thing
  • is in (List, Of, Things) --- target a bunch of things (Done, Closed, Resolved) typically
  • not in (List, of, Things) --- do not include a bunch of things
  • -1w --- relative time. You can also use -1d for day
  • "2015/3/15" --- specific dates
@mallond
mallond / postgres-cheatsheet.md
Created November 9, 2017 22:39 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@mallond
mallond / Windows Logger
Created June 26, 2017 18:18
Client Site JS Global Error Handler
<script type="text/javascript">
window.onerror = function(msg, url, line, col, error) {
// Note that col & error are new to the HTML 5 spec and may not be
// supported in every browser. It worked for me in Chrome.
var extra = !col ? '' : '\ncolumn: ' + col;
extra += !error ? '' : '\nerror: ' + error;
// You can view the information in an alert to see things working like this:
alert("Error: " + msg + "\nurl: " + url + "\nline: " + line + extra);
@mallond
mallond / remove all node_modules
Last active June 16, 2017 01:51
remove all node_modules
find ./ -name "node_modules" -exec rm -rf {} \;
@mallond
mallond / Actions
Last active May 25, 2017 22:20
React-Redux Cheat Sheet
.
@mallond
mallond / gist:f380eeefabbfd89eaa345e1f66b4017f
Created April 19, 2017 20:06
Polymorphic Mongoose Example - discriminator - Easy to understand
const mocha = require('mocha');
const assert = require('assert');
const async = require('async');
describe('Test Mongo Connection and Detail Creation', () => {
it('should return result', (done) => {
Verifying that "davidmallon.id" is my Blockstack ID. https://onename.com/davidmallon
Verifying that "malloda.id" is my Blockstack ID. https://onename.com/malloda
@mallond
mallond / gist:78986f7db045fa10fac2412e7a75a8e5
Last active February 22, 2017 21:20
Node Emitter Example
/**
* Created by dm on 2/22/17.
*/
'use strict';
// Set Up a Node Global OnOff Emitter
const events = require('events');
if (!global.OnOffEmitter) {
global.OnOffEmitter = new events.EventEmitter();
}