Skip to content

Instantly share code, notes, and snippets.

View mindreframer's full-sized avatar
🎯
Focusing

Roman Heinrich mindreframer

🎯
Focusing
View GitHub Profile
@mindreframer
mindreframer / docker-clear-orphaned-volumes.py
Created December 4, 2013 13:51
volumes clearing script for docker, a copy from https://github.com/dotcloud/docker/issues/197 with some fixes
#!/usr/bin/python
import json
import os
import shutil
import subprocess
import re
dockerdir = '/var/lib/docker'
volumesdir = os.path.join(dockerdir, 'volumes')
@mindreframer
mindreframer / links.md
Last active December 29, 2024 18:57
GUITAR LESSONS
@mindreframer
mindreframer / s3-downloader.rb
Created January 17, 2013 00:21
S3 downloader (signed URL)
# encoding : utf-8
#!/usr/bin/env ruby
require 'openssl'
require 'digest/sha1'
require 'base64'
require 'date'
require 'uri'
class S3; end
class << S3
@mindreframer
mindreframer / cleanup_rails_views.rb
Created July 26, 2012 01:13
Cleanup views with tidy (erb)
require 'tidy'
#Tidy.path = '/opt/local/lib/libtidy.dylib' # or where ever your tidylib resides
Tidy.path = '/usr/lib/libtidy.A.dylib'
def generate(files)
tidy = Tidy.open(:show_warnings=>true) do |tidy|
tidy.options.indent = 'auto'
tidy.options.show_body_only = true
tidy.options.output_xhtml = true
@mindreframer
mindreframer / install.md
Last active June 1, 2022 20:05
Lunchy OSX

Lunchy: OSX launchctl wrapper

https://github.com/sosedoff/lunchy-go

# install it
wget http://dl.bintray.com/sosedoff/generic/0.1.0_darwin_amd64.zip
unzip 0.1.0_darwin_amd64.zip
mv lunchy /usr/local/bin/
@mindreframer
mindreframer / instructions.md
Last active April 29, 2020 11:47
Installing POP OS

Fresh Pop OS installation:

WIFI

  • install wifi drivers sudo apt install firmware-b43-installer

Chrome

  • install chrome
@mindreframer
mindreframer / hex-packages.md
Last active August 13, 2019 17:31
Elixir - Dealing with nested datastructures (validating / traversing / transforming)
@mindreframer
mindreframer / adjustowner.sql
Created July 11, 2019 14:46
Change owner for a Postgres DB (all relations)
- https://stackoverflow.com/questions/1348126/modify-owner-on-all-tables-simultaneously-in-postgresql
-- I like this one since it modifies tables, views, sequences and functions owner of a certain schema in one go (in one sql statement), without creating a function
DO $$DECLARE r record;
DECLARE
v_schema varchar := 'public';
v_new_owner varchar := 'bn_redash';
text_var1 varchar := '';
text_var2 varchar := '';
text_var3 varchar := '';
BEGIN