Skip to content

Instantly share code, notes, and snippets.

Buy VM Guide

Initial setup

  • ssh root@<IP> -P
  • passwd # change root password
  • apt-get update
  • apt-get install sudo
  • useradd -m juno -s /bin/bash -g sudo
  • passwd juno
  • su juno
  • mkdir .ssh
@ebaker
ebaker / gitprint.js
Last active July 9, 2020 23:07 — forked from beevelop/gitprint.js
Print GitHub markdown files
// from https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white; border: 0;')
document.querySelector('body').appendChild(document.querySelector('#readme'))
document.querySelector('#readme > .Box-header').setAttribute('style', 'display: none !important')
document.querySelector('#readme > .Box-body').setAttribute('style', 'padding-top: 0 !important;')
document.querySelectorAll('li').forEach(function(li) {li.setAttribute('style', 'line-height: 1.4; font-size: 15px;')})
document.querySelectorAll('p').forEach(function(p) {p.setAttribute('style', 'font-size: 15px;')})
document.querySelectorAll('h2').forEach(function(h2) {h2.setAttribute('style', 'margin-bottom: 14px')})
@ebaker
ebaker / cloudSettings
Last active July 2, 2020 22:26
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-02T22:26:45.065Z","extensionVersion":"v3.4.3"}
@ebaker
ebaker / log-debug.sublime-snippet
Created November 15, 2016 02:33
oc log debug
<snippet>
<content><![CDATA[log.debug('$2 $1', $1);$0]]></content>
<tabTrigger>deb</tabTrigger>
<scope>source.js</scope>
<description>log.debug()</description>
</snippet>
@ebaker
ebaker / git-aliases.md
Created October 9, 2015 10:38 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
#!/bin/sh
# 5:23 PM Friday, October 18, 2013 - Jim Priest
# origin script found here: http://python.dzone.com/articles/tips-using-git-pre-commit-hook
# Modified with console checks and to ignore commented file
FILES_PATTERN='\.(js|coffee)(\..+)?$'
FORBIDDEN='ddescribe\|iit\|console\.log'
if git diff --cached --name-only | grep -E -q $FILES_PATTERN ;
then
@ebaker
ebaker / sweeper
Last active August 29, 2015 14:21
minesweeper
// minesweeper goals
// - board with (height, width, numOfMines)
// - [x] create board with no mines
// - [x] create board with mine
// - [x] randomly place mines
// - [x] loop through each square without bomb and calculate value
// - [x] handle squares on edges
// - insert #s surrounding block
// - [x] insert 1 correct hint
// note: (0, 0) is top left