Skip to content

Instantly share code, notes, and snippets.

@op-ct
op-ct / gnome-terminal.settings.dconf
Created June 16, 2015 22:07
Load settings with `dconf load /org/gnome/terminal/legacy/profiles:/ < gnome-terminal.settings.dconf`
[:f146e78d-e9ab-4ad2-876f-4722b0513936]
foreground-color='#a7a7a7'
visible-name='Base 16 Twilight Dark'
login-shell=true
palette=['#1e1e1e', '#cf6a4c', '#8f9d6a', '#f9ee98', '#7587a6', '#9b859d', '#afc4db', '#a7a7a7', '#5f5a60', '#cf6a4c', '#8f9d6a', '#f9ee98', '#7587a6', '#9b859d', '#afc4db', '#ffffff']
use-theme-colors=false
use-theme-background=false
bold-color-same-as-fg=true
bold-color='#a7a7a7'
background-color='#1e1e1e'
@op-ct
op-ct / catalog_dump_from_spec_test.rb
Last active January 13, 2016 10:04 — forked from spiette/gist:5280394
Dumping the catalog from within a Puppet spec test
# WARNING: massive screen scroll
$stdout.puts self.catalogue.to_yaml
# Save to file
File.open( '_catalog.yaml', 'w'){ |f| f.puts self.catalogue.to_yaml }
@op-ct
op-ct / Rakefile
Last active August 28, 2015 14:33
Simple ERB templater
require 'erb'
require 'ostruct'
desc 'Generate a README.md using the module name'
task 'generate', [:name] do |t, args|
metadata = OpenStruct.new( args.to_hash )
erb_file = File.expand_path('README.md.erb', File.dirname(__FILE__))
template = File.open( erb_file, 'r').readlines.join("\n")
content = ERB.new template
File.open( 'README.md', 'w' ){ |f| f.puts content.result(binding) }
@op-ct
op-ct / 0_reuse_code.js
Created October 21, 2015 00:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@op-ct
op-ct / .gitconfig
Last active August 7, 2017 22:04
.gitconfiggery
[alias]
# colorful log with one-line entries
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# colorful log with a summary of updated files
lgf = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --name-only
# colorful log with a summary of updated files & the commit message
lgff = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\n\n%b' --abbrev-commit --name-only
@op-ct
op-ct / Gemfile.rb
Created November 10, 2015 22:17
Octokit multi-repo thingamie
source 'https://rubygems.org'
gem 'octokit' # github api
# native ruby git ops
gem 'rugged', git: 'git://github.com/libgit2/rugged.git', submodules: true
gem 'highline' # pretty prings
gem 'ruby-progressbar'
gem 'rake'
gem 'pry' # god-mode
@op-ct
op-ct / fedora23_broadcom_wl_install.sh
Last active November 20, 2015 17:49
fedora23_broadcom_wl_install.sh
#/usr/bin/env bash
# Install some pacakages we'll need to compile the driver below.
sudo dnf install git kernel-devel gcc patch -y
# Create working dir for Broadcom driver files and patches.
mkdir hybrid_wl_f23
# Change to working dir.
cd hybrid_wl_f23
@op-ct
op-ct / install-gradle-centos.sh
Last active February 17, 2016 23:23 — forked from parzonka/install-gradle-centos.sh
Install gradle on redhat/centos linux
# Originally from:
# https://gist.github.com/parzonka/9371885
# ------------------------------------------------------------------------------
# - required packages: unzip, java
# - installs to /opt/gradle
# - existing versions are not overwritten/deleted
# - seamless upgrades/downgrades
# - $GRADLE_HOME points to latest *installed* (not released)
# ------------------------------------------------------------------------------
@op-ct
op-ct / jenkins_gerrit_travis.rb
Created February 20, 2016 10:30
Jenkins Gerrit Trigger that Checks on Travis CI results
# - gets latest Travis CI result and exits 0 (CR+1) or fails (CR-1)
# - gets the latest GitHub PR pull from Gerrit comments
# - warns if latest Gerrit patchset is newer than latest GitHub PR pull (because Travis results aren't the latest)
# TODO: warn if latest Travis request is newer than latest GerritHub PR PR pull (because GerritHub needs to be updated)
require 'travis'
require 'travis/tools/github'
require 'json'
gerrit = {}
@op-ct
op-ct / jira_batch_create.sh
Last active October 3, 2016 21:08
jira-cli example to submit a bunch of Jira subtasks
# requires jira-cli gem (from https://github.com/drn/jira-cli; 0.3.6 in example)
PARENT_ISSUE=SIMP-1054
JIRA_ASSIGNEE=chris.tessmer
# Create a batch of new issues
for i in `cat x`; do jira new -p SIMP -c pupmod-simp-$i -s "Fix STRICT_VARIABLES=yes for pupmod-simp-$i" -a ${JIRA_ASIGNEE} -i Sub-task --parent=${PARENT_ISSUE}; done