Skip to content

Instantly share code, notes, and snippets.

@mendhak
mendhak / apigateway.tf
Last active April 24, 2024 10:52
Terraform - API Gateway with greedy path (proxy+) calling httpbin. Also includes deployment
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {
@mendhak
mendhak / .keychron_k2_pro_via_layout.md
Created March 11, 2024 19:22
Keychron K2 Pro - VIA layout, with sterling symbol and em dash

Remapped the lighting key to printscreen.

Removed the lighting related keys on layer 3

Macro for £ (fn1 + g) and — (fn1 + d)

@mendhak
mendhak / .keychron_k6_pro_via_layout.md
Last active February 27, 2024 08:44
Keychron K6 Pro - VIA layout, with sterling symbol and em dash

Remapped the rightmost keys to delete, home, end. (Instead of Home, pg up, pg down).

Remapped the lighting key to printscreen.

Removed the lighting related keys on layer 3

Macro for £ (fn1 + g) and — (fn1 + d)

@mendhak
mendhak / update-another-users-pullrequest.md
Last active July 26, 2023 07:35
Update a pull request by pushing to another user's forked repository

Add the other user as a remote

#Using https
git remote add otheruser https://github.com/otheruser/yourrepo.git
# Or - Using SSH
git remote add otheruser git@github.com:otheruser/yourrepo.git

Fetch

git fetch otheruser

@mendhak
mendhak / README.md
Created July 24, 2023 22:13
Run Llama2 on GPU
@mendhak
mendhak / Dockerfile
Last active May 9, 2023 11:21 — forked from jkpl/Dockerfile
saml2aws Docker image, updated to work with symlink and get latest version
FROM debian:stable-slim
RUN apt-get update && \
apt-get install -y ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
RUN CURRENT_VERSION=$(curl -Ls https://api.github.com/repos/Versent/saml2aws/releases/latest | grep 'tag_name' | cut -d> curl -L "https://github.com/Versent/saml2aws/releases/download/v${CURRENT_VERSION}/saml2aws_${CURRENT_VERSION}_linu> tar xvfz saml2aws.tar.gz && \
mv saml2aws /usr/local/bin/saml2aws && \
chmod +x /usr/local/bin/saml2aws && \
@mendhak
mendhak / InteractiveScrollView.java
Last active February 21, 2023 08:25 — forked from marteinn/InteractiveScrollView.java
ScrollView with a OnBottomReachedListener for Android
package se.marteinn.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
/**
* Triggers a event when scrolling reaches bottom.
@mendhak
mendhak / starhscale.py
Created May 15, 2012 21:10
A custom GTK widget; horizontal slider with stars for rating an item
#!/usr/bin/env python
"""
StarHScale a Horizontal slider that uses stars
Copyright (C) 2006 Mark Mruss <selsine@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@mendhak
mendhak / dummy-web-server.py
Created August 25, 2017 21:33 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else. Also prints POST body
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@mendhak
mendhak / example.js
Created April 23, 2021 14:11
swagger-jsdoc with JSON and YAML jsdoc examples
/**
* @openapi
* "/abc": {
* "get": {
* "description": "Welcome to swagger-jsdoc!",
* "responses": {
* "200": {
* "description": "Returns a mysterious string.",
* "content": {
* "text/xml": {