Skip to content

Instantly share code, notes, and snippets.

@polymetis
polymetis / tips.md
Created February 26, 2018 19:16 — forked from ferd/tips.md
  • plan for code that is easy to delete/replace rather than code that is easy to extend or reuse. As needs change, you're more likely to change the assumptions about what the system should do than in how many ways it should do it. If the code needs extending, it's then easy to replace it with a bit that's easy to extend
  • planning for code that is easy to throw away is the best way I've found to properly bake in abstraction and isolation. The question is always "if I take this shit out or change its implementation entirely, do I need to replace anything else?". If the answer is "yes", then you may be leaking into other components. Fix it. turns out when you have that, it's also suddenly easier to reuse code.
  • write a prototype of whatever significant task you have to do, and consider it a draft. Use it to figure out requirements or to make your first mistakes in. Throw it away. Try again. As I gain more experience I find my prototypes smaller and individually more solid, but anything where I lack experience t
@polymetis
polymetis / tips.md
Created February 26, 2018 19:16 — forked from ferd/tips.md
  • plan for code that is easy to delete/replace rather than code that is easy to extend or reuse. As needs change, you're more likely to change the assumptions about what the system should do than in how many ways it should do it. If the code needs extending, it's then easy to replace it with a bit that's easy to extend
  • planning for code that is easy to throw away is the best way I've found to properly bake in abstraction and isolation. The question is always "if I take this shit out or change its implementation entirely, do I need to replace anything else?". If the answer is "yes", then you may be leaking into other components. Fix it. turns out when you have that, it's also suddenly easier to reuse code.
  • write a prototype of whatever significant task you have to do, and consider it a draft. Use it to figure out requirements or to make your first mistakes in. Throw it away. Try again. As I gain more experience I find my prototypes smaller and individually more solid, but anything where I lack experience t

Keybase proof

I hereby claim:

  • I am polymetis on github.
  • I am polymetis (https://keybase.io/polymetis) on keybase.
  • I have a public key ASD0Qbo3YuW-EftORHbsI7S_i4Ehzv7B1_TjZTPaRV6mmAo

To claim this, I am signing this object:

@polymetis
polymetis / everyone-can-cook.md
Last active January 23, 2017 20:32
Ratatouille thing

#Ratatouille

##Back story. I was watching the film and decided to attempt to play around as attempt to cook something fun for me and my friend that has seen the film.

##Shopping List - Gets complicated because I change it based on season

  • A few (4)Red or Orange Bell peppers or any other sweet pepper but avoid the colour green. (it looks unpleasant)
  • Garlic - Just get a whole bulb
  • Some form of eggplant -- Japanese Eggplant makes ones life easier.
@polymetis
polymetis / elixir_sips.exs
Created December 28, 2015 11:46 — forked from sheharyarn/elixir_sips.exs
Download videos from ElixirSips.com
defmodule Episode do
defstruct id: nil, name: nil, video: nil, markdown: nil, post: nil
def list do
[
%Episode{id: "001", post: "271", name: "Introduction and Installing Elixir", video: "1366", markdown: "1382" },
%Episode{id: "002", post: "275", name: "Basic Elixir", video: "1367", markdown: "1357" },
%Episode{id: "003", post: "280", name: "Pattern Matching", video: "14879", markdown: "1413" },
%Episode{id: "004", post: "284", name: "Functions", video: "5086", markdown: "1559" },
%Episode{id: "005", post: "298", name: "Mix and Modules", video: "5087", markdown: "1654" },
@polymetis
polymetis / Emacs_starter.pl
Last active September 17, 2015 17:44 — forked from railwaycat/Emacs_starter.pl
Start Emacs.app from CLI
#!/usr/bin/perl
# Emacs starter for Emacs mac port
# Thanks to Aquamacs Project and David Reitter
my $args = "";
my $tmpfiles = "";
for my $f (@ARGV) {
git clone https://github.com/rabbitmq/rabbitmq-dotnet-client.git rabbitmq && cd rabbitmq && git checkout rabbitmq_v3_5_4
@polymetis
polymetis / ssh-help.sh
Last active December 20, 2015 06:49
Ssh helper for windows.
#!/usr/bin/env bash
read -p "Enter the *email* that you use for GitHub: " email
ssh-keygen -t rsa -C "$email" <<!
id_rsa
!
key="$(cat ~/.ssh/id_rsa.pub)"
@polymetis
polymetis / remoteswaptossh.sh
Last active December 20, 2015 05:39
This does all the .git changes we need on preexisting repositories. These changes don't need to committed and this is a destructive process.
#!/usr/bin/env bash
if [ -e .gitmodules ]; then
sed -i 's/https:\/\/github.com\//git@github.com:/g' .git/config
awk '/path =/ { print $3 }' .gitmodules | xargs -imetrasub -P10 bash -c "cd .git/modules/metrasub && sed -i 's/https:\/\/github.com\//git@github.com:/g' config"
else
echo "run this from the top"
exit 1
fi
@polymetis
polymetis / gist:5863879
Last active December 18, 2015 23:48
Ignore build artifacts.
git status -sb | grep '??' | awk '{ print $2 }' | xargs -I buildfile bash -c "echo "buildfile" >> .gitignore"