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 / node example
Created August 29, 2018 22:38
Simple No Modules pure Node Example
/*
* Primary file for API
*
*/
// Dependencies
var http = require('http');
var url = require('url');
var StringDecoder = require('string_decoder').StringDecoder;
@mallond
mallond / gist:ec9c41a3fb206a29ae0cd4a7a4083e14
Last active November 1, 2016 20:02
Mac osx X11 Docker Example
#firefox example
- Install XQuartz
open -a XQuartz
ip=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
xhost + $ip
@mallond
mallond / Git Backup
Last active February 24, 2017 22:54
GIT Download All
#!/bin/bash
#
# Crude script to backup an organisations repositories and its members forks.
#
# Name of organisation
ORG="change"
# Needed to talk to API
@matheus-santos
matheus-santos / cheat_sheet_socketio
Last active May 1, 2019 19:23
SocketIO cheat sheet to emit messages through sockets
// SocketIO cheat sheet
// SocketIO is a library that makes websockets communications easier.
// Page: http://socket.io/
// ref: http://stackoverflow.com/a/10099325
// send to current request socket client
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.sockets.emit('message', "this is a test");
@rxaviers
rxaviers / gist:7360908
Last active September 22, 2024 02:51
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@mallond
mallond / JQuery Include
Last active December 21, 2015 18:49
JQuery Include -
boilerplate
HTML Boilerplate - simple HTML includes using jquery
As a long time JSP developer, transitioning into the fabulous world of Pure HTML and JavaScript front-end development. There is a need to divide and conquer your web interface into manageable and reusable parts. This is a simple demo using JQuery that divides a front end website into three reusable parts.
Header
Main Container
Navigation
Footer
There is not much to it. JQuery does all the magic.
@mallond
mallond / MongoDB Cheats
Created July 13, 2013 17:27
MongoDB Cheats
Various Cheats found on the Web
mongo //Start Mongo
show dbs //Show databases
use mydb //User database named "­myd­b"
db //Show selected database
help //Get help
show collec­tion //Show collec­tions from a database
Finds - db.collection
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active September 7, 2024 22:18
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@pguillory
pguillory / gist:729616
Created December 5, 2010 23:51
Hooking into Node.js stdout
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}