Skip to content

Instantly share code, notes, and snippets.

@butterybread
butterybread / post.sh
Created July 6, 2017 10:42
cURL POST JSON data
curl -X POST -d '{"username":"xyz","password":"xyz"}' \
http://example.com/path/to/resource \
--header "Content-Type:application/json"
@butterybread
butterybread / css-thoughts.md
Created May 29, 2017 12:57
Some CSS problems
@butterybread
butterybread / css-transforms.md
Created May 29, 2017 12:56
CSS transforms on a parent, break the position: fixed of children.
@butterybread
butterybread / developer-discipline.md
Created May 29, 2017 12:41
An article about developer discipline

Developer discipline

I believe the source of many bugs in code can be found in how much discipline a developer has.

When a developer builds a new feature in an existing codebase, there are many routes he can take. Each resulting in a different quality of code written. Usually when a new feature needs to be introduced, some code needs to be changed or refactored to allow for the new functionality.

The case of simplicity

If this developer wants to write the feature as fast as possible, he will write code until the requirements are met.

@butterybread
butterybread / why-i-choose-elm.md
Last active June 12, 2017 16:07
An explanation about why I think using Elm is a good idea

Why I choose Elm as my primary tool

I want to build for the web

I want to build for the web, why? Because that way you reach the most people the easiest & cheapest way. Building for native does not allow you to reach people that easily because:

  • It takes longer to build the app because you need to build for different platforms. Therefor it's more expensive.
  • People have to find your app in the platform specific app store.
  • We don't need the possible performance benefits that native applications have to offer. At least not most of the time.
@butterybread
butterybread / npm-install-shortcuts.md
Created May 25, 2017 08:08
NPM shortcut commands for installation

NPM shortcut commands

  • Installing a package & save to devDependencies npm install {package} --save-dev
    shortcut: npm i {package} -D

  • Installing a package & save to dependencies npm install {package} --save
    shortcut: npm i package -S

@butterybread
butterybread / js-object-iteration.md
Created May 25, 2017 08:06
How to iterate over object properties

Iterating over object properties

var foo = {bar: 'test'};

Object.keys(foo).forEach( function(key) {
    // property name
    console.log(key);
    // property value
    console.log(foo[key]);
});
@butterybread
butterybread / hidden-files.md
Last active May 29, 2017 12:51
Bash alias for showing and hiding hidden files in finder

Show hidden files in Finder (macOS/OSX)

Create an alias to quickly show hidden files or hide them again. Add these aliases to your .bash_profile or .zshrc file.

alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES;
killall Finder /System/Library/CoreServices/Finder.app'

alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO;
killall Finder /System/Library/CoreServices/Finder.app'