Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Kareem Hepburn magicalbanana

  • Höfn, Iceland
View GitHub Profile
@magicalbanana
magicalbanana / kitty.conf
Created Mar 7, 2019 — forked from NeoTheFox/kitty.conf
kitty config with solarized dark theme
View kitty.conf
# vim:fileencoding=utf-8:ft=conf
# Font family. You can also specify different fonts for the
# bold/italic/bold-italic variants. By default they are derived automatically,
# by the OSes font system. Setting them manually is useful for font families
# that have many weight variants like Book, Medium, Thick, etc. For example:
# font_family Operator Mono Book
# bold_font Operator Mono Thick
# bold_italic_font Operator Mono Medium
font_family Hack
@magicalbanana
magicalbanana / logging.bash
Created Feb 1, 2019 — forked from goodmami/logging.bash
Basic logging commands for Linux shell scripts
View logging.bash
#!/bin/bash
##
## Simple logging mechanism for Bash
##
## Author: Michael Wayne Goodman <goodman.m.w@gmail.com>
## Thanks: Jul for the idea to add a datestring. See:
## http://www.goodmami.org/2011/07/simple-logging-in-bash-scripts/#comment-5854
## Thanks: @gffhcks for noting that inf() and debug() should be swapped,
## and that critical() used $2 instead of $1
View select2-boostrap-v4-alpha-6.scss
//
// Variables
// --------------------------------------------------
// Variables directly translating Bootstrap variables
// -------------------------
$s2bs-border-radius-base: $border-radius !default;
$s2bs-border-radius-large: $border-radius-lg !default;
$s2bs-border-radius-small: $border-radius-sm !default;
@magicalbanana
magicalbanana / query.sql
Created Oct 29, 2018 — forked from ramiroaznar/query.sql
How to find duplicate values with PostgreSQL
View query.sql
select * from table t1
where (select count(*) from table t2
where t1.field = t2.field) > 1
order by field
@magicalbanana
magicalbanana / assets.rake
Created Oct 27, 2018 — forked from guilleiguaran/assets.rake
Fixed rake assets:precompile task
View assets.rake
desc "Compile all the assets named in config.assets.precompile"
task :precompile do
# We need to do this dance because RAILS_GROUPS is used
# too early in the boot process and changing here is already too late.
if ENV["RAILS_GROUPS"].to_s.empty? || ENV["RAILS_ENV"].to_s.empty?
ENV["RAILS_GROUPS"] ||= "assets"
ENV["RAILS_ENV"] ||= "production"
Kernel.exec $0, *ARGV
else
Rake::Task["environment"].invoke
@magicalbanana
magicalbanana / compress.go
Created Feb 11, 2018 — forked from bussiere/compress.go
compress uncompress a string in golang
View compress.go
package main
import (
"bytes"
"compress/gzip"
"fmt"
"encoding/base64"
"io/ioutil"
)
View shell
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
# another fix
kubectl create clusterrolebinding --user system:serviceaccount:kube-system:default kube-system-cluster-admin --clusterrole cluster-admin
https://github.com/kubernetes/dashboard/issues/2326#issuecomment-326651713
# for fixing helm
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
@magicalbanana
magicalbanana / go
Created Jan 29, 2018
A sample code to show how to check if a directory is empty extending magicalbanana/env custom parser funcs
View go
package config
import (
"fmt"
"io"
"net/url"
"os"
"path/filepath"
"reflect"
)
You can’t perform that action at this time.