Skip to content

Instantly share code, notes, and snippets.

@nirbhabbarat
nirbhabbarat / gitlab-on-minikube-helm3.md
Last active April 13, 2024 07:15
setup gitlab on minikube using helm3

Setup gitlab on minikube using helm3

Start minikube with virtualbox driver

minikube start \
  --driver=virtualbox \
  --cpus 4 \
  --memory 8192

Recomended: 8 CPU and 30 GB RAM (for demo we are going to use minimal setup)

@AlexVPopov
AlexVPopov / clojure.spec cheat sheet.md
Last active February 21, 2020 07:08
A cheat sheet for clojure.spec

clojure.spec cheat sheet

Specs

Require

(ns my.ns
  (:require [clojure.spec.alpha :as s]))

I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

@rmm5t
rmm5t / OUTPUT.md
Last active February 19, 2021 21:18
How to properly introduce a new counter_cache to an existing Rails project.

Fast/efficient approach:

-- execute("UPDATE posts SET comments_count = (SELECT count(1) FROM comments WHERE comments.post_id = posts.id)")
   -> 1.3197s

Slow/naïve approach:

@tsmsogn
tsmsogn / primes.rb
Last active May 6, 2019 01:45
[ruby]Sieve of Eratosthenes with Ruby
def primes(max)
nums = Array.new(max + 1, 1)
nums[0] = nums[1] = 0
(2..Math.sqrt(max)).each do |sieve|
if nums[sieve] == 1
(2 * sieve).step(max, sieve).each do |num|
nums[num] = 0
end
end
@J2TEAM
J2TEAM / sublime-text-scopes.md
Last active January 17, 2024 22:44 — forked from iambibhas/scopes.txt
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@YoussefKababe
YoussefKababe / Dockerfile
Created September 15, 2014 04:00
Dockerfile to compile and install nginx with additional modules
FROM ubuntu:trusty
MAINTAINER Youssef Kababe "youssef.kbe@gmail.com"
RUN apt-get update
RUN apt-get install -y wget
RUN apt-get install -y libpcre3-dev
RUN apt-get install -y zlib1g-dev
RUN apt-get install -y make
RUN wget http://nginx.org/download/nginx-1.6.1.tar.gz
@somebox
somebox / presenters.md
Last active March 26, 2022 02:12
Thoughts About Rails Presenters

Thoughts about Rails Presenters

This is a collection of links, examples and rants about Presenters/Decorators in Rails.


The "Decorator" pattern slowly started gaining popularity in Rails several years ago. It is not part of core Rails, and there's many different interpretations about how it should work in practice.

Jay Fields wrote about it in 2007 (before he switched back to Java and then Clojure): http://blog.jayfields.com/2007/03/rails-presenter-pattern.html

@adrianorsouza
adrianorsouza / sublime-command-line.md
Last active September 26, 2023 16:26
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@tadast
tadast / ssl_puma.sh
Last active January 29, 2024 04:41 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key