Skip to content

Instantly share code, notes, and snippets.

View AliOsm's full-sized avatar
😎
Killing my GPU

Ali Hamdi Ali Fadel AliOsm

😎
Killing my GPU
View GitHub Profile
@AliOsm
AliOsm / .env
Last active July 8, 2024 17:21
Deploy Rails, GoodJob, PostgreSQL, Redis, Memcached, Meilisearch, and ChromaDB on the same server using Kamal.
KAMAL_REGISTRY_PASSWORD=dckr_pat_xXXxx_x0xXxXx-xX-XXX0xX0x-x
RAILS_MASTER_KEY=00x00xxx000xxx000000xx0x000x0x00
POSTGRES_PASSWORD=xXxxx0xXXx0
MEILI_MASTER_KEY=xXxxx0xXXx0
BLAZER_DATABASE_URL=postgres://service:{POSTGRES_PASSWORD}@service-name-postgres:5432/service_production
@AliOsm
AliOsm / rubyonrails.yml
Last active June 23, 2023 21:00
Ruby on Rails GitHub Actions CI/CD Template
name: "Ruby on Rails CI/CD"
on:
push:
branches: [ "main" ]
paths-ignore:
- '.devcontainer/**'
- '.env.example'
- '.erb-lint.yml'
- '.gitignore'
@AliOsm
AliOsm / main.dart
Created November 18, 2022 10:53
Example Flutter screen
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 1;
int n, m, a[N], type, s, e, v, seg[N * 4], lazy[N * 4];
void pro(int at, int l, int r) {
seg[at] += lazy[at] * (r - l + 1);
#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 1;
int n, m, a[N], type, s, e, t, v, seg[N * 4];
void build(int at, int l, int r) {
if(l == r) {
seg[at] = a[l];
@AliOsm
AliOsm / trie.cpp
Created July 1, 2022 17:45
Trie data structure using pointers
#include <bits/stdc++.h>
using namespace std;
int n, m;
string s;
struct trie {
trie *next[26];
int count;

Keybase proof

I hereby claim:

  • I am aliosm on github.
  • I am aliosm (https://keybase.io/aliosm) on keybase.
  • I have a public key ASBOK7TEUiX6xqQeFr2wVPmF01LOAVoCLdch8dXGL08F-go

To claim this, I am signing this object:

def hotel_cost (nights) :
return 140*nights
def plane_ride_cost (city):
if city=="Charlotte" :
return 183
elif city=="Tampa" :
return 220
elif city=="Pittsburgh" :
return 222
elif city=="Los Angeles" :
require 'net/http'
source = Net::HTTP.get('udemy.com', '/bootstrap-beginners-landing-page/learn/#/lecture/3461564')
puts source
Started GET "/posts/11/edit" for 127.0.0.1 at 2015-04-04 22:41:21 +0200
Processing by PostsController#edit as HTML
Parameters: {"id"=>"11"}
User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 27]]
Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 11]]
Rendered posts/_form.html.erb (5.8ms)
Rendered posts/edit.html.erb within layouts/application (6.7ms)
Rendered layouts/_head_tag.html.erb (242.7ms)
Rendered layouts/_header.html.erb (5.1ms)
Rendered layouts/_messages.html.erb (0.3ms)