Skip to content

Instantly share code, notes, and snippets.

View cthulhu666's full-sized avatar

Jakub Głuszecki cthulhu666

  • Warsaw, Poland
View GitHub Profile

Create `dbt` service account in GCP

Needs “Bigquery User” and “Bigquery Connection User” roles.

Needs them in both conrad-production-api and conrad-analytics-staging

Install dbt

https://docs.getdbt.com/docs/installation

brew update
brew tap fishtown-analytics/dbt
brew install dbt
@kosmotaur
kosmotaur / pingMenu.lua
Created January 31, 2017 11:19
pingMenu for Hammerspoon
local pingMenubar = hs.menubar.new()
local function splitByNewline(str)
local t = {}
local function helper(line) table.insert(t, line) return '' end
helper((str:gsub('(.-)\n', helper)))
return t
end
local function updatePing()
local p = hs.network.ping('bbc.co.uk')
hs.timer.doAfter(5, function()
@resouer
resouer / pod1.yml
Last active March 13, 2023 08:40
How to implement volumes-from in Kubernetes Pod?
---
apiVersion: v1
kind: Pod
metadata:
name: server
spec:
containers:
- image: resouer/sample:v2
name: war
lifecycle:
@romaninsh
romaninsh / swapon.service
Created December 1, 2014 10:05
Set up swap on CoreOS
create this file in your /root folder
$ fleetctl load swapon.service
$ fleetctl start swapon.service
This will create swap file on all nodes of your CoreOS cluster without prior setup.
See also http://cloudinit.readthedocs.org/en/latest/topics/examples.html#adjust-mount-points-mounted
@andyshinn
andyshinn / DEISGCE.md
Last active June 7, 2020 19:17
Deis in Google Compute Engine

Deis in Google Compute Engine

Let's build a Deis cluster in Google's Compute Engine!

Google

Get a few Google things squared away so we can provison VM instances.

Google Cloud SDK

@demirhanaydin
demirhanaydin / tire-parent-child-example.rb
Last active December 22, 2015 23:48
Elasticsearch parent/child example with tire
require 'rubygems'
require 'tire'
Tire.configure { logger 'elasticsearch.log', :level => 'debug' }
class Document
attr_accessor :title, :content
include Tire::Model::Persistence
include Tire::Model::Search
include Tire::Model::Callbacks
@JensRantil
JensRantil / example.html
Last active December 16, 2015 17:19
Improvement of http://stackoverflow.com/a/14774995/260805 that handles generated title attribute on timeago tags.
<html ng-app="MyApplication">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="timeago-angular.js" type="text/javascript"></script>
<script src="my-app.js" type="text/javascript"></script>
</head>
<body>
<div ng-controller="myController">
<span class="time-ago" title="{{ myTime }}"></span>
</div>
#!/usr/bin/env ruby
#------------------------------------------------------------------------------
# Aggregate Print useful information from /proc/[pid]/smaps
#
# pss - Roughly the amount of memory that is "really" being used by the pid
# swap - Amount of swap this process is currently using
#
# Reference:
# http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361
@nebiros
nebiros / Gemfile
Created May 23, 2012 15:58
rails + unicorn + rbenv + init.d daemon
group :production do
gem "unicorn"
end
@eddorre
eddorre / Rails Migrations Post Merge Git Commit Hook
Created April 18, 2011 21:58
Rails Migrations Post Merge Git Commit Hook
Get notifications when there are migrations that need to be run in a Rails project:
https://img.skitch.com/20110418-c9y3ttap3tai7frc43f38qtb8e.jpg
In your Rails project edit the .git/config file to add the following:
[rails]
automigrate = false
automigrateforegroundcolor = yellow
automigratebackgroundcolor = black