Skip to content

Instantly share code, notes, and snippets.

View usametov's full-sized avatar

Ulan Sametov usametov

  • Asta Nova Enterprise Solutions
View GitHub Profile
@benjiqq
benjiqq / lisps.md
Last active June 14, 2023 04:17
rust lisps
@chamaeleon
chamaeleon / Tablecloth Use
Last active August 2, 2021 19:20
Basic use of the Clojure tablecloth library
(ns weather.core
(:require [tablecloth.api :as api])
(:gen-class))
(defonce weather
(api/dataset "https://vega.github.io/vega-lite/examples/data/seattle-weather.csv"
{:key-fn keyword}))
(defn avg [data]
(double (/ (reduce + data) (count data))))
@jeremychone
jeremychone / rust-xp-01-s3.rs
Last active May 10, 2024 02:12
Rust Quick Example to connect to S3 and Minio bucket server
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use std::{error::Error, str};
use s3::bucket::Bucket;
use s3::creds::Credentials;
use s3::region::Region;
use s3::BucketConfiguration;
// Youtube Walkthrough - https://youtu.be/uQKBW8ZgYB8
@lukaszkorecki
lukaszkorecki / Dockerfile
Created February 17, 2021 17:04
AWS Lambda + babashka + minimal container image
FROM alpine:3.11.3
RUN apk update && apk add curl ca-certificates unzip && rm -rf /var/cache/apk/*
RUN curl -L 'https://github.com/babashka/babashka/releases/download/v0.2.10/babashka-0.2.10-linux-static-amd64.zip' -o /tmp/bb.zip && \
unzip /tmp/bb.zip && \
mv bb /usr/bin/bb && \
chmod +x /usr/bin/bb
RUN mkdir -p /app
@adam-james-v
adam-james-v / vidwiz.clj
Last active January 22, 2023 09:42
Clojure/babashka script to help automate some of my video editing pipeline
#!/usr/bin/env bb
(ns vidwiz.main
"This is a prototype script for automating a portion of my video editing using ffmpeg."
(:require [clojure.java.shell :refer [sh]]
[clojure.string :as st]
[cheshire.core :refer [parse-string]]))
;; util
(defn get-extension
@lagenorhynque
lagenorhynque / github_graphql_api_client.clj
Last active March 18, 2024 20:46
A minimal GitHub GraphQL API client implemented as a babashka (Clojure) script
#!/usr/bin/env bb
(ns github-graphql-api-client
(:require
[babashka.curl :as curl]
[cheshire.core :as cheshire]
[clojure.pprint :refer [pprint]]))
(def auth-token (System/getenv "AUTH_TOKEN"))
(def graphql-query
@FreddieOliveira
FreddieOliveira / docker.md
Last active May 20, 2024 05:40
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@borkdude
borkdude / scrape_tables.clj
Created October 5, 2020 08:21
Extract HTML tables with babashka and bootleg
(ns scrape
(:require [babashka.pods :as pods]
[clojure.walk :as walk]))
(pods/load-pod "bootleg") ;; installed on path, use "./bootleg" for local binary
(require '[babashka.curl :as curl])
(def clojure-html (:body (curl/get "https://en.wikipedia.org/wiki/Clojure")))
@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.