Skip to content

Instantly share code, notes, and snippets.

View sadiqmmm's full-sized avatar

Mohammed Sadiq sadiqmmm

View GitHub Profile
@sadiqmmm
sadiqmmm / ultralearning.md
Created June 24, 2026 17:04 — forked from hlfshell/ultralearning.md
Ultralearning Notes

Ultralearning

The following is the notes I took years ago on the book Ultralearning by Scott Young. The bombastic title and promise to learn virtually anything quickly makes it sound as if its the typical marketing-powered fluff-filled nonfiction book stores are overflowing with, but something about this book stuck with me. After finishing it I quickly went back and wrote these thoughts down. While I don't follow his layout of plans regularly, I have used it to guide a lot of my own self education.

I've successfully utilized it when I needed to refresh on mathematics for my Master's degree (a host of skills that atrophied sigificantly for the dozen years between undergrad and the masters). I've also used it to self-study subjects like Robotics and Deep Learning (though I did decide in the end to go for the Master's accreditation).

I share it here with hopes that someone finds it useful.


Principle 1 - Metalearning

@sadiqmmm
sadiqmmm / microgpt.py
Created February 12, 2026 20:31 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@sadiqmmm
sadiqmmm / paperform-get-form-page-url.js
Last active March 19, 2024 22:53
Get your form’s URL when it’s embedded in another page - With Paperform, you have the capability to automatically retrieve the URL of your form's page, enabling you to discern the origins of your submissions when they're integrated into other web pages. Gain fresh insights into where your customers are completing your forms!
<div data-paperform-id="jwps"></div>
// Note: Please don't change/format the below line no 3. Keep as it is.
<script>(function () { var script = document.createElement('script'); script.src = "https://paperform.co/__embed.min.js"; document.body.appendChild(script); })()</script>
<script>
(function () {
const currentPageUrl = window.location.href;
const form = document.querySelector("[data-paperform-id='jwps']");
// formsubmiturl is your custom Pre-fill key:
form.setAttribute('prefill', "formsubmiturl=" + currentPageUrl);
@sadiqmmm
sadiqmmm / 1 SETUP Ubuntu 20.04 LTS (DigitalOcean)
Created September 22, 2023 19:31 — forked from VasylShevchenko/1 SETUP Ubuntu 20.04 LTS (DigitalOcean)
Deploy Rails to VPS(Ubuntu 20.04LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL, RVM, Certbot
//------ ROOT --------
root# apt-get update
root# apt-get upgrade
// Dependencies
apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev \
libpcre3-dev unzip htop zip

Add puma to you Gemfile:

gem "puma"

Install Puma Gem

change to project directory
bundle install
@sadiqmmm
sadiqmmm / gist:17a85b94ff96ad1ad41113dd2e6b1a8e
Created November 23, 2022 20:06 — forked from BjornDCode/gist:5cb836a6b23638d6d02f5cb6ed59a04a
Tailwind - Fixed sidebar, scrollable content
// Source: https://twitter.com/calebporzio/status/1151876736931549185
<div class="flex">
<aside class="h-screen sticky top-0">
// Fixed Sidebar
</aside>
<main>
// Content
</main>
@sadiqmmm
sadiqmmm / _form.html.erb
Created November 15, 2022 15:52 — forked from dalezak/_form.html.erb
Stimulus.js Toggle Controller to show and hide form elements based on select value
<div class="form-group">
<%= form.label :type, "Type", class: "font-weight-bold" %>
<%= form.select :type, ['TextQuestion', 'UrlQuestion'], { include_blank: true }, { class: "form-control", data: { action: "input->toggle#changed", target: "toggle.select" } } %>
</div>
<div class="form-group">
<%= form.label :name, "Name", class: "font-weight-bold" %>
<%= form.text_field :name, class: "form-control" %>
</div>
<div class="form-group" data-target="toggle.element" data-values="UrlQuestion">
<%= form.label :url, "URL", class: "font-weight-bold" %>
<?php
$countries =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
@sadiqmmm
sadiqmmm / generate-certificate.sh
Created December 3, 2021 14:20 — forked from dorianmariecom/generate-certificate.sh
Generate certificate for HTTPS on localhost macOS / Rails / Puma
#!/bin/bash
set -e
echo "> Removing certificate"
sudo security delete-certificate -c localhost || true
echo "> Generating .key"
sudo openssl genrsa -out config/localhost.key 4096
@sadiqmmm
sadiqmmm / gist:aac0bc187ad84be9c35528500bdeb876
Created November 1, 2021 12:09 — forked from pglombardo/gist:7206464
The War on ActionView with Russian Doll Caching

Rails 4 is out featuring Russian Doll caching (AKA Cache Digests). In this article, I apply Russian Doll caching to one of my poorer performing Rails 3 pages using the cache_digests gem.

ActionView templates are great. They are easy to code, manage and extend but the one thing they are not is fast...at least not out of the box.

In this article, I'll be using AppNeta's TraceView to time ActionView performance. If you haven't used TraceView before, checkout my previous article Instrumenting Ruby on Rails with TraceView.

ActionView is Slow; Pitfalls Ahead

ActionView puts forth a great development pattern of views and partials that is easy to understand, implement and maintain but that comes at a cost: The rendering process is complex and slow.