Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Newton iamnewton

🏠
Working from home
View GitHub Profile
@iamnewton
iamnewton / bash-colors.md
Last active Jan 20, 2021
The entire table of ANSI color codes.
View bash-colors.md

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
View better-console.js
// I provide a logging API that has some special sauce for formatting.
const echo = (function() {
let queue = [];
var ECHO_TOKEN = {};
const RESET_INPUT = "%c ";
var RESET_CSS = "";
// Attach formatting utility method.
function alertFormatting (value) {
queue.push({
@iamnewton
iamnewton / _images.scss
Created Jan 24, 2020
Some SCSS helpers
View _images.scss
/// Rounded corners on images
/// @author Newton Koumantzelis
/// @since 1.0.0 - The Sith
/// @example html
/// <img src="" class="img-broken" alt="Generic image">
.img-broken {
position: relative;
min-height: 3rem;
&::before,
@iamnewton
iamnewton / readFile.js
Last active Dec 4, 2019
Read a file line-by-line and update a line of it
View readFile.js
const fs = require('fs');
const readline = require('readline');
const readFile = () => {
// create readline interface and output to a new file; can't figure out how to write to same file
const readInterface = readline.createInterface({
input: fs.createReadStream(findup('sonar-project.properties')),
output: fs.createWriteStream('sonar-project.properties.temp'),
console: false
});
@iamnewton
iamnewton / developer.keg
Last active Nov 24, 2018
A keg file for mass installation of developer-related Homebrew casks via kegger (https://github.com/chrisopedia/kegger)
View developer.keg
brave-browser
brave-browser-beta
brave-browser-dev
chromium
chromedriver
dash
docker
dropbox
firefox
firefox-developer-edition
View keybase.md

Keybase proof

I hereby claim:

  • I am iamnewton on github.
  • I am chrisopedia (https://keybase.io/chrisopedia) on keybase.
  • I have a public key whose fingerprint is 6AE7 083D 4404 07C0 7EB1 18EA 3802 412D 8420 6E38

To claim this, I am signing this object:

@iamnewton
iamnewton / personal.keg
Last active Nov 15, 2018
A keg file for mass installation of personal Homebrew casks via kegger (https://github.com/chrisopedia/kegger)
View personal.keg
betterzip
qlimagesize
qlstephen
qlvideo
quicken
quicklook-csv
slack
suspicious-package
webpquicklook
@iamnewton
iamnewton / fonts.keg
Last active Nov 11, 2018
A keg file for mass installation of Homebrew fonts via kegger (https://github.com/chrisopedia/kegger)
View fonts.keg
font-anonymous-pro
font-arvo
font-bitter
font-input
font-inconsolata
font-league-gothic
font-orbitron
font-redacted
font-source-code-pro
font-source-sans-pro
@iamnewton
iamnewton / server.keg
Last active Nov 5, 2018
A keg file for mass installation of server-related Homebrew casks via kegger (https://github.com/chrisopedia/kegger)
View server.keg
handbrake
prismatik
screens-connect
sonos
@iamnewton
iamnewton / javascript-for-vim-refactoring.js
Created Sep 25, 2015 — forked from derwiki/javascript-for-vim-refactoring.js
Moving faster with Vim (5-minute lightning talk presentation). I wasn't inspired to learn effective command of Vim until I saw some people flying around faster than I thought was possible. The goal of this presentation is to call out how slow "normal" text editing is, and how many keystrokes can be reduced by using increasingly more terse Vim co…
View javascript-for-vim-refactoring.js
$(function() {
// good opportunity to combine into a single statement
// qq w cw <esc> A, <esc> 0 j q
var a = 10;
var b = 20;
var c = 30;
var d = 40;
var e = 50;
// opportunity to simplify syntax
You can’t perform that action at this time.