Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View asimihsan's full-sized avatar

Asim Ihsan asimihsan

View GitHub Profile
@asimihsan
asimihsan / notes.md
Last active April 3, 2024 16:00
Dependency Injector example

Step 1: Define Service Classes and Interfaces

# services.py
import requests

class CsvContentFetcher:
    def fetch(self, csv_uri: str) -> str:
        # Depending on the scheme in `csv_uri`, fetch the content from S3 or local file
        if csv_uri.startswith("s3://"):
2023-11-23 16:06:00
2023-11-23 16:06:00 LocalStack version: 3.0.0
2023-11-23 16:06:00 LocalStack Docker container id: ed4bb0a693d4
2023-11-23 16:06:00 LocalStack build date: 2023-11-16
2023-11-23 16:06:00 LocalStack build git hash: 6dd3f3d
2023-11-23 16:06:00
2023-11-23 16:06:00 2023-11-23T21:06:00.514 INFO --- [ MainThread] l.bootstrap.licensingv2 : Successfully activated cached license license_7e180b27-97b2-498e-854e-c79669e857f2:pro from /var/lib/localstack/cache/license.json 🔑✅
2023-11-23 16:06:00 Localstack returning with exit code 55. Reason:
2023-11-23 16:06:00 ===============================================
2023-11-23 16:06:00 License activation failed! 🔑❌
tee $HOME/setup_mac_inner.sh <<'EOF'
#!/usr/bin/env bash
# See: https://github.com/thoughtbot/laptop/blob/master/mac
set -euo pipefail
fancy_echo() {
local fmt="$1"; shift
PROJECT_NAME=project-name
cargo install cargo-edit --features vendored-openssl,vendored-libgit2
cargo install cargo-deny
mkdir "$PROJECT_NAME"
cd "$PROJECT_NAME"
git init .
cat << EOF > Cargo.toml
[workspace]
@asimihsan
asimihsan / pm1.als
Created January 20, 2022 05:49
Formal modeling as a design tool
sig Package {}
run example {}
@asimihsan
asimihsan / sidbar-rust.docs.js
Last active September 30, 2020 16:57
Greasemonkey script for forcefully enabling sidebar for Rust docs, even for narrow pages
// ==UserScript==
// @name Enable Sidebar for Rust docs
// @namespace https://asim.ihsan.io
// @version 0.1
// @description Always enable sidebar on Rust documentation pages.
// @author Asim Ihsan.
// @match https://doc.rust-lang.org/*
// @grant none
// @run-at document-idle
// ==/UserScript==
@asimihsan
asimihsan / enwiki-20191202-top-10k.txt
Last active January 26, 2020 07:21
Top 10k words based on 20200113 Wikipedia dump - English
# See: https://github.com/asimihsan/word-frequencies
# Raw frequencex.txt.gz file: https://www.dropbox.com/s/ectbjiupvesxruc/enwiki-20191202-frequencies.txt.gz?dl=0
# Uses Debian wamerican + wbritish + wcanadian as a dictionary. You get much better results if you use 3of6game as
# a dictionary.
the
and
was
for
with
from
@asimihsan
asimihsan / plwiki-20200113-top-10k.txt
Last active January 26, 2020 07:12
Top 10k words based on 20200113 Wikipedia dump - Polish
# See: https://github.com/asimihsan/word-frequencies
# Raw frequencies.txt.gz file: https://www.dropbox.com/sh/yy9dnue1kvf0kuw/AAC1ZpoEnH_dn4FLLN1RHf2Pa?dl=0
się
dostęp
ang
jest
przez
oraz
jako
nie
@asimihsan
asimihsan / setup.md
Created March 13, 2017 15:05
Installing Deep Learning tools on an AWS P2 instance from scratch
<?xml version="1.0"?>
<!-- See http://gnaural.sourceforge.net -->
<schedule>
<gnauralfile_version>1.20101006</gnauralfile_version>
<gnaural_version>1.0.20110215</gnaural_version>
<date>20160206 14:09:00</date>
<title>AcademicPerformanceEnhancement</title>
<schedule_description>Alternate between 14 Hz and 22 Hz (http://preview.tinyurl.com/zt4wm2a)</schedule_description>
<author>asymptote</author>
<totaltime>20.0</totaltime>