Skip to content

Instantly share code, notes, and snippets.

@strawberryjello
strawberryjello / csv-transposer
Last active August 29, 2015 13:56
Transposes the contents of a CSV file and writes the CSV result to another file.
#! /usr/bin/env python
"""CSV transposer
Transposes the contents of a CSV file and writes the CSV result to another
file.
(see: http://en.wikipedia.org/wiki/Transpose)
Runs on Python 2.7.3
@strawberryjello
strawberryjello / permutations.py
Last active August 29, 2015 13:57
Sample usage of Python's itertools.permutations()
#! /usr/bin/env python
"""Permutation generator
Just a sample usage of itertools.permutations() (Python 2.6 and later)
"""
import itertools
@strawberryjello
strawberryjello / notes-on-sane-dev.org
Created January 22, 2015 06:40
Notes on Sane Development

Notes on Sane Development

Sane development?

  • Aim: increase efficiency, productivity, and overall happiness
  • Mileage may vary depending on workplace culture, individual preference, etc
    • mediation between personal goals and workplace goals

Aspects

  • Technologies and tools
  • Culture
  • Personal development
@strawberryjello
strawberryjello / notes-on-git.org
Last active August 29, 2015 14:13
Notes on Git

Notes on Git

Why git?

  • you have a distributed workflow
  • you need to version files even when you’re offline
  • you have a central “master” repo, but you still want git’s benefits
    • speed, smaller repo size, ease of branching/tagging, etc

Workflows

  • many different branching models exist; use what works
    • depends on: team size, collaboration model, release schedules and characteristics, etc
@strawberryjello
strawberryjello / stack-example.js
Created January 29, 2015 04:05
Sample implementation of a stack in JavaScript.
// see: http://jsfiddle.net/r5p9Lbj5/
function Node(value) {
this.bottom = null;
this.value = value;
}
function Stack() {
this.top = null;
}
@strawberryjello
strawberryjello / notes-on-dev-lifecycle.org
Last active August 29, 2015 14:14
Notes on the Development Life Cycle

Notes on the Development Life Cycle

Prioritizing

  • avoid changing the list of items to work on mid-sprint
    • be firm with clients – prevent them from sneaking in new items/making changes to their requested features mid-sprint
    • item priorities may change mid-sprint, but keep in mind that changes like these are disruptive
  • points or man-days: YMMV
    • whichever you choose, be consistent (this is a team decision)
    • make sure everyone agrees on what each unit of effort stands for
    • estimates are not absolute
@strawberryjello
strawberryjello / gist:f27fc782a2a440c63751
Created February 10, 2015 11:30
Echo list of files returned by git status --porcelain (minus status code)
#!/usr/bin/env bash
# meant to be run in the repo top directory
IN=`git status --porcelain | cut -c4-`
arr=$(echo $IN)
for x in $arr
do
echo $x
done
@strawberryjello
strawberryjello / notes-on-emacs-vim.org
Last active August 29, 2015 14:18
Notes for Vim and Emacs beginners.

Notes on Vim and Emacs

Why Vim?

  • Vim is the descendant of vi, designed to be (mostly) backwards-compatible
    • learning vi is useful when you need to edit a file over ssh, since vi is usually installed in any UNIX/UNIX-based system by default
  • Vim’s shortcuts and design, once you learn them, help you search/create/edit/etc files quicker
    • these shortcuts are also used in UNIX-based terminals, such as the man page viewer
  • Vim offers flexible window management (splitting, etc) and works well with tmux, a popular terminal multiplexer
  • Vim’s plugin ecosystem is thriving and full of useful tools for development in most (if not all) languages
  • you can extend Vim yourself using Vimscript

Why Emacs?

@strawberryjello
strawberryjello / .rubocop.yml
Created April 14, 2015 04:27
Sample Rubocop YAML file
Metrics/MethodLength:
Enabled: false
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation
Style/Documentation:
Enabled: false
Style/DotPosition:
@strawberryjello
strawberryjello / cops.yml
Created April 29, 2015 05:42
Sample YAML file containing all Rubocop cops for a Rails project (generated using rubocop --show-cops, no custom cops specified)
# Available cops (218)
# Type 'Lint' (38):
Lint/AmbiguousOperator:
Description: Checks for ambiguous operators in the first argument of a method invocation
without parentheses.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
Enabled: true
Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method