Skip to content

Instantly share code, notes, and snippets.

View adham90's full-sized avatar
🤖
running...

Adham EL-Deeb adham90

🤖
running...
View GitHub Profile
@n-studio
n-studio / DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Last active March 28, 2024 22:53
Deploy a web app on a dedicated server with Kamal

Warning

This gist is still a draft. At the moment it is not functional: see basecamp/kamal#257

Motivation

Kamal was designed with 1 service = 1 droplet/VPS in mind.
But I'm cheap and I want to be able to deploy multiple demo/poc apps apps on my $20/month dedicated server.
What the hell, I'll even host my private container registry on it.

@netgfx
netgfx / App.tsx
Created August 20, 2021 21:47
complete-framer+supabase
import { ComponentType, useEffect } from "react"
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
import { randomColor } from "https://framer.com/m/framer/utils.js@^0.9.0"
import { createClient } from "https://cdn.skypack.dev/@supabase/supabase-js"
import { md5 } from "https://cdn.skypack.dev/pure-md5"
import { browser, checkUsername, checkPassword, useStore } from "./globals.ts"
// Learn more: https://www.framer.com/docs/guides/overrides/
export function initDB(Component): ComponentType {
@rponte
rponte / git-revert-multiple-commits.sh
Created September 25, 2019 16:07
Git: reverting a range of commits
##
# Reverting a range of commits
#
# git --pretty=oneline --abbrev-commit older_commit..newer_commit # not includes the oldest commit
# git --pretty=oneline --abbrev-commit older_commit^..newer_commit # includes the oldest commit
##
# just to be sure about the commits, list them
git log --pretty=oneline --abbrev-commit 1f80548^..4b293d5
@arturhoo
arturhoo / Easily Start and Stop EC2 Instances.md
Last active April 7, 2017 22:44
Ruby script to start and stop instances

How to use the script below

Requirements:

Two files are required: ~/.aws/config and a file containing instances ids, one per line, eg:

~/.aws/config

@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@pubis
pubis / redis.rb
Created December 11, 2011 09:07
Redis config and initialization for rails
#config/initializers/redis.rb
require 'redis'
require 'redis/objects'
REDIS_CONFIG = YAML.load( File.open( Rails.root.join("config/redis.yml") ) ).symbolize_keys
dflt = REDIS_CONFIG[:default].symbolize_keys
cnfg = dflt.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym]
$redis = Redis.new(cnfg)
Redis::Objects.redis = $redis