Skip to content

Instantly share code, notes, and snippets.

View rot26's full-sized avatar
💬
is typing...

Chris Coleman rot26

💬
is typing...
  • Denver, Colorado, United States
  • 01:19 (UTC -06:00)
View GitHub Profile
@rot26
rot26 / bootstrap-raw.html
Created January 12, 2015 21:07
Raw Bootstrap Template
<!DOCTYPE html>
<html lang="en">
<head>
<title>Raw | Bootstrap Template</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
@rot26
rot26 / browser
Created October 21, 2015 22:35 — forked from defunkt/browser
pipe html to a browser
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo '<h1>hi mom!</h1>' | browser
# $ ron -5 man/rip.5.ron | browser
if [ -t 0 ]; then
if [ -n "$1" ]; then
@rot26
rot26 / promise.js
Created June 24, 2016 23:24
Playing with Promises
'use strict';
console.log('starting promise.js');
console.time('A');
function asyncFunc() {
return new Promise(
function (resolve, reject) {
console.log(1);
@rot26
rot26 / .npmrc
Last active July 17, 2018 04:09
default npmrc
# Default npm flag settings
# Put this `.npmrc` file in your npm project root next to `package.json`
# Always save packages that get installed to avoid "missing dependencies"
save = true
# Always save the EXACT version that you ran and installed.
# upgrade to latest version on each new version (put `npm outdated` in your CI)
# `npm outdated && yarn upgrade --latest && npm outdated`
save-exact = true
@rot26
rot26 / rsync-as-root-example.sh
Last active April 29, 2019 21:02
[rsync as root example] #rsync #sudo #root #scp #ssh
#rysnc as root by using `--rsync-path`
SOURCE_DIR="host-in-config:/path/to/copy"
DEST_DIR="/path/to/destination"
rsync \
--recursive \
--update \
--links
--rsync-path="sudo rsync" \
-e ssh \
@rot26
rot26 / default-bash.sh
Last active July 14, 2019 21:06
[default bash script] #default #fav #bash #shell
#!/usr/bin/env bash
# SheBang defaults to environment's bash
# Set errexit / Do not continue on errors
set -e;
# Set bash debug
if [[ "$@" == *"--debug"* ]] || [ ${BASH_DEBUG} ]; then
export BASH_DEBUG=true;
set -x;
@rot26
rot26 / get-public-key.sh
Last active September 21, 2018 15:52
[Get Public key from private key] #ssh
# https://askubuntu.com/questions/53553/how-do-i-retrieve-the-public-key-from-a-ssh-private-key
# Example:
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
@rot26
rot26 / fuser.sh
Last active December 7, 2018 20:07
[process listening on port] 3 Ways to Find Out Which Process Listening on a Particular Port https://www.tecmint.com/find-out-which-process-listening-on-a-particular-port/ #networking #port #debug #ops
# Least recommended
#
# WARNING: Do not use delete flags with fuser! - Courtesy of ssolt
#
# Source:
# https://www.tecmint.com/find-out-which-process-listening-on-a-particular-port/
#
# $ sudo yum install psmisc #RHEL/CentOS
# $ sudo apt install psmisc #Debian/Ubuntu
# $ sudo dnf install psmisc #Fedora 22+
@rot26
rot26 / objects-over-classes.md
Created October 7, 2018 16:21 — forked from indiesquidge/objects-over-classes.md
We are better off avoiding ES6 classes in JavaScript when possible

Plain JavaScript objects are better than classes when they can be used, and many popular modern frameworks have adopted their use.

Consider that in React a component can be created as either a class or as an object.

// using a class
class Welcome extends React.Component {
  render() {
 Hello, {this.props.name}
@rot26
rot26 / ssh-remove-a-known-host.sh
Created October 9, 2018 15:31
[ssh remove hostname] #ssh
# ssh-keygen -R hostname [-f known_hosts_file]
HOSTNAME=""
ssh-keygen -R "${HOSTNAME}"