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 / app.rb
Created January 18, 2025 12:16
Microservice using Sinatra framework to embed text using Multilingual E5 Large embeddings model.
require 'json'
require 'sinatra'
require 'onnxruntime'
require 'tokenizers'
require_relative './embedder.rb'
before do
@AliOsm
AliOsm / .env
Last active February 23, 2025 12:41
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