Skip to content

Instantly share code, notes, and snippets.

View teddyzetterlund's full-sized avatar

Teddy Zetterlund teddyzetterlund

View GitHub Profile
@stettix
stettix / things-i-believe.md
Last active March 20, 2024 17:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

Get started with [Mocha] testing

Make a package.json file if you don't have one yet:

npm init
# just keep pressing enter.
# this will create the file `package.json`

Ruby on Rails coding standard

{{toc}}

Code style

  • Use UTF-8. It’s 21 century, 8bit encodings dead now.
  • Use 2 space indent, not tabs
  • Use Unix-style line endings
  • Keep lines not longer than 80 chars
@staltz
staltz / introrx.md
Last active May 30, 2024 18:43
The introduction to Reactive Programming you've been missing
@allolex
allolex / README.md
Last active August 29, 2015 14:00
Regular expression examples
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@redox
redox / base.html.haml
Last active May 16, 2020 13:13
Algolia extends HipChat to customer support
#chat-box.ubuntu.hidden-xs
.closed
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()'
.m-l-small
= link_to_function 'Chat with us', 'chat.show()'
.opened{style: 'display: none'}
.header
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none'
# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@bf4
bf4 / services.md
Last active August 2, 2017 13:26
Analytics, Metrics and Error monitoring services (and roll your own via logging, etc)