Skip to content

Instantly share code, notes, and snippets.

View torsday's full-sized avatar

Chris Torstenson torsday

View GitHub Profile
@torsday
torsday / psr-fixer.md
Last active August 14, 2018 21:40
psr-fixer.md

php-cs-fixer

the composer way (recommended)

$ composer global require friendsofphp/php-cs-fixer

the homebrew way

@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@torsday
torsday / postgres.md
Created August 22, 2013 23:45
PostgreSQL #db #notes

PostgreSQL

Basics

List Databases

$ psql -l

Open up database

@perplexes
perplexes / node.rb
Created June 5, 2013 22:14
Hash/Array Tree searcher
# > n = Node.find_where(terms2){|v| !v["Section"].empty?}
# => #<Node key="Sections" value=Hash children=1>
# > puts n.path
# => [0]["Departments"]["Department"][3]["Courses"]["Course"][1]["Sections"]
class Node
attr_reader :parent, :key, :value, :children
def initialize(parent, key, value)
@parent = parent
@key = key
@value = value
@ndelage
ndelage / continuous integration.md
Last active December 17, 2015 10:19
Continuous Integration Intro

Continuous Integration for Fun and Profit

Continu-what?

Definition: the practice of frequently integrating one's new or changed code with the existing code repository -Wikipedia

Merging new code into master often sounds awesome, but we've been learning the value of testing and the importance of a passing test suite.

But, as your projects grow, your test suite should grow as well. We're all lazy and forget to run the entire test suite everytime we create a new commit. For large projects, running the entire test suite can take hours. So we do what all lazy people do, make a computer to the work for us.

@ndelage
ndelage / testing tips.md
Last active December 17, 2015 09:09
Testing Tips & Tricks

Testing Tips & Tricks

Run a single test

In a large application, running all the tests at once using rake spec can make it difficult to check the output of the test you're working on. Especially if you have many failing or pending tests. Run a single test by running rspec:

rspec spec/models/account.rb

You can be even more specific and run a specific example from a test file. For example, given the following tests:

11: describe "#deposit!" do
@ndelage
ndelage / testing with rspec.md
Last active February 21, 2017 16:11
Testing with RSpec

Definitions

General Testing

  • TDD Test Driven Development. Write examples before implementation.
  • BDD Behaviour-Driven Development is about implementing an application by describing its behavior from the perspective of its stakeholders. (The Rspec Book)
  • RSpec (mention alternatives, write a simple hand sewn test)

Testing Terms

@TalkativeTree
TalkativeTree / DBC_advice.txt
Last active December 16, 2015 23:39
A collection of advice and tips organized into loose categories. Looking for additions and feedback. If you want to submit ideas via survey, I've put up a survey on Gorilla Survey!
+# Learning
+#Proper Variable Naming - make the variable name descriptive and concise
=>don't name after the data structure
=>avoid numbered variables (var1, var2, var3)
=>avoid single character names (except for short blocks or indexes)
+#Proper Method Naming
=>use the right suffix (! or ?)
=>the name should reflect the method's single responsibility
+#Keep it DRY
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 18, 2024 08:32
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname