Skip to content

Instantly share code, notes, and snippets.

View neumachen's full-sized avatar
🏠
Working from home

Kareem H neumachen

🏠
Working from home
  • Bergen, Norway
  • 13:49 (UTC -12:00)
View GitHub Profile
//
// 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;
@neumachen
neumachen / query.sql
Created October 29, 2018 15:50 — forked from ramiroaznar/query.sql
How to find duplicate values with PostgreSQL
select * from table t1
where (select count(*) from table t2
where t1.field = t2.field) > 1
order by field
@neumachen
neumachen / assets.rake
Created October 27, 2018 23:41 — forked from guilleiguaran/assets.rake
Fixed rake assets:precompile task
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
@neumachen
neumachen / compress.go
Created February 11, 2018 01:56 — forked from bussiere/compress.go
compress uncompress a string in golang
package main
import (
"bytes"
"compress/gzip"
"fmt"
"encoding/base64"
"io/ioutil"
)
psql -lqt | cut -d \| -f 1 | grep -qw <db_name>
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
@neumachen
neumachen / go
Created January 29, 2018 01:35
A sample code to show how to check if a directory is empty extending magicalbanana/env custom parser funcs
package config
import (
"fmt"
"io"
"net/url"
"os"
"path/filepath"
"reflect"
)
wget -qO- https://api.github.com/orgs/ORG/repos | jq ".[].ssh_url" | xargs -L 1 git clone
func Milk(cow interface{Mooing; Grazing})