Skip to content

Instantly share code, notes, and snippets.

@squarism
squarism / fish_shell_switch.txt
Last active January 9, 2018 22:04
Fish Shell Awesomeness
Early days of fish shell impressions.
This is like honeymoon time but I really like it so far.
1. iTerm
alt+command goes back in history. Weird. Thought this was tab-navigation in iTerm.
2. Editing past commmands!
up & down to go through history (as usual) but then left-right take you into edit mode!
But how would you add a newline? Fish doesn't like `;` as much as zsh for newlines.
Well ... you can hit alt+enter and it will do a soft return!
@squarism
squarism / favorite_packages.txt
Created November 2, 2017 21:09
Favorite VSCode Packages
- Auto Close Tag
- Babel ES6/ES7
- Color Highlight
- elm
- ESLint
- Go
- indent-rainbow
- Nord
- Prettier
- vscode-icons
@squarism
squarism / calculator.rb
Created September 25, 2017 20:36
Calculator with paper tape side effects
class Calculator
# add two numbers with side effects to tape
def add(number1, number2)
sum = number1 + number2
tape("#{number1} + #{number2}")
tape("=\n#{sum}")
sum
end
@squarism
squarism / create_a_class_the_hard_way.rb
Last active April 11, 2018 17:12
create_a_class_the_hard_way.rb
require "rspec/autorun"
Car = Class.new
Car.class_exec {
define_method :start, Proc.new { @started = true }
define_method :started, Proc.new { @started }
}
RSpec.describe Car do
it "starts" do
@squarism
squarism / perl_bloat.md
Created December 17, 2016 05:15
The problem with perl pie

Perl One Liners Bring Way Too Much To the Table

I've always used perl -pie for inline text replacement. Because I got used to it, I used it a lot. Because I used it a lot, I used it a lot. Because I used it a lot, a lot I love it. I shun sed. But what is this bringing with it? An entire language?

Get:4 http://ftp.us.debian.org/debian/ jessie/main powerline armhf 1.2-2 [36.9 kB]
Fetched 259 kB in 1s (250 kB/s)
perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

@squarism
squarism / databases_filesystems.md
Last active April 7, 2017 02:37
File Systems are Databases

THIS IS A MAJOR WIP - SKIP TO TRUSTY SECTION, ARCH DID NOT WORK WITH THE MYSQL VERSIONS. I WILL BE CLEANING THIS UP AS I DEVELOP THE TALK / BLOG POST.

Install OS

Install Arch (this doesn't matter, just get a Linux box) https://wiki.archlinux.org/index.php/Installation_guide

If you are in a VM, add a 4gb disk.

@squarism
squarism / amazon_is_almost.md
Last active April 22, 2024 22:39
Amazon is Almost

Amazon is Almost

AWS is full of almost things. This is a list of surprises across all services. Your job as an engineer is to think critically about trade offs. Amazon is an abstraction on hardware. You reap hardware bliss ignorance but you pay for the abstraction. There is no free lunch. Hardware still exists. Hardware in itself is an abstraction.

With AWS you are renting a hardware abstraction to avoid having to host your own. They do not run the abstractions after this point. You do.

@squarism
squarism / tips_soapbox.md
Last active December 17, 2015 17:58
Tips Soapbox

What

I hope this isn't a rant. This is just a list of stuff I see people doing that could be better. It's stuff I've seen on jobs / pairing / screencasts. This is a soapbox for tips and tricks

Copy and Pasting

Accidental copy

@squarism
squarism / deep_equal.go
Created December 7, 2015 00:47
Bleh Bleh Go Slices Comparing
package main
import (
"fmt"
"reflect"
)
func main() {
cheatCode := []string{"x", "x", "y", "start"}
input := []string{"x", "y", "y", "start"}
@squarism
squarism / minecraft.init.d
Last active February 6, 2024 03:21
Minecraft Server Startup Script For Ubuntu That Supports Multiple Servers
# Below is a script I use to run my server. Replace RENAME (should be in about 4 places) to
# whatever your world is called. I've used this to run Technic server packs.
# The great thing about this is you can run it with multiple servers
# on the same box using tmux session names.
# Steal this. Don't give me credit. @squarism MIT License
# ------------------------------------------------------------------------------------------
#!/bin/sh