Skip to content

Instantly share code, notes, and snippets.

@caarlos0
caarlos0 / list-git-branches.groovy
Last active October 13, 2023 12:12 — forked from ThabetAmer/list-git-branches.groovy
Jenkins Groovy script to read Git repo branches and list them in an array, can be suited with Active Choice Jenkins Plugin
#!/usr/bin/env groovy
/**
* List all Git branches of a repo.
* @author thabet.amer@gmail.com
* @since Jenkins 2.204.1
* @params String url for Git repo URL, String credentialID, Bool activeChoice if ActiveChoice plugin used, String defaultBranch
* @return String array of branch names
*
* Dependencies:
@caarlos0
caarlos0 / five.md
Created November 26, 2019 01:47 — forked from mfridman/five.md
top 5 most common .goreleaser files

10666361bf2ddb7070c9ea6756b1e8ce327a9edb

8 found

builds:
  # List of builds
  - # First Build
    env:
    - CGO_ENABLED=0
@caarlos0
caarlos0 / top-50.md
Created November 26, 2019 01:45 — forked from mfridman/top-50.md
top 50 project (by stars) using goreleaser
@caarlos0
caarlos0 / postmortem.md
Created September 26, 2016 14:39 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
---------------------------------------------------------------------------------------------------------
# app/helpers/application_helper.rb
---------------------------------------------------------------------------------------------------------
def horizontal_simple_form_for(record, options={}, &block)
options[:html] ||= {}
options[:html][:class] = "form-horizontal #{options[:html][:class]}".rstrip
options[:wrapper] = :bootstrap_horizontal
simple_form_for(record, options, &block)
end
---------------------------------------------------------------------------------------------------------
#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f

Setup Mac OS X Mountain Lion

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first time I needed to reinstall everything, maybe the next time...

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables