Skip to content

Instantly share code, notes, and snippets.

View sfertman's full-sized avatar
💭
🐗 🌳

sfertman

💭
🐗 🌳
View GitHub Profile
@yogthos
yogthos / README.md
Last active March 24, 2024 10:35
command line util for grabbing current weather for a city using OpenWeather API

usage

Create an account at https://openweathermap.org and get an API key. Note that it can take up to a couple of hours for the key to become active. Add an environment variable OPEN_WEATHER_API_KEY with the value of the key.

run the script:

./weather.clj Toronto,CA
@adam-james-v
adam-james-v / qblock.cljc
Last active August 11, 2024 21:08
Code for a mario Question Block Model (Clojure compiled to openscad)
;; code related to a youtube video:
;; https://youtu.be/3euk0-JF_tc
(ns qblock.main
(:require [clojure.string :as st]
[scad-clj.model :refer :all]
[scad-clj.scad :refer [write-scad]]))
(fn! 30)
@islishude
islishude / node-mysql2-promise-query-stream.js
Created September 7, 2020 10:28
node-mysql2 query stream with Promise
// https://github.com/sidorares/node-mysql2/issues/677
const mysql = require("mysql2/promise");
const stream = require("stream");
const dbconn = mysql.createPool({
connectionLimit: 10,
host: "127.0.0.1",
user: "user",
password: "password",
database: "database",
@sfertman
sfertman / gh-grapfql.sh
Last active May 15, 2020 22:21
graph QL command line peculiarities
curl -H "Authorization: bearer <token>" -X POST -d \
'{"query": "query { repository(owner:\"octocat\", name:\"Hello-World\") { issues(last:20, states:CLOSED) { edges { node { title url labels(first:5) { edges { node { name}}}}}}}}"}' \
https://api.github.com/graphql
@ashiklom
ashiklom / docker-compose.ci.yml
Created January 15, 2020 19:48
GitHub actions + Docker Compose example
# CI overrides
version: '3'
services:
web:
environment:
- DATABASE_URL
- DJANGO_SETTINGS_MODULE
- SECRET_KEY
- PORT
@sfertman
sfertman / certbot.md
Last active June 10, 2020 18:11
Generating and renewing certs using certbot and route 53 plugin

With docker

docker run --rm --name certbot \
  -v "/etc/letsencrypt:/etc/letsencrypt" \
  -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
  -v "/path/to/local/aws-config-dir:/var/lib/letsencrypt/aws:ro" \
  -e AWS_SHARED_CREDENTIALS_FILE=/var/lib/letsencrypt/aws/credentials \
  certbot/dns-route53 certonly \
    --agree-tos \
    -m my-email@my-email-server.com \    
@cfstras
cfstras / 0_Mirror a repository using GitLab CI.md
Last active August 14, 2025 13:07
How to mirror a repository using GitLab CI

Mirroring a repository using GitLab CI

inspired by https://gitlab.com/freifunkks/mirror-scripts

This can be used, for example, to clone a repository living on github over to GitLab in order to run CI

Setup

  • Setup separate repository with mirror scripts. We'll call it "mirror-scripts"
  • push the two files below.
  • in the .gitlab-ci.yml replace MY_REPO with your repo name
@cjus
cjus / .docker_aliases
Last active July 13, 2023 23:50
Docker aliases
#!/bin/sh
alias dm='docker-machine'
alias dmx='docker-machine ssh'
alias dk='docker'
alias dki='docker images'
alias dks='docker service'
alias dkrm='docker rm'
alias dkl='docker logs'
alias dklf='docker logs -f'
@nginx-gists
nginx-gists / api_backends.conf
Last active September 26, 2025 04:25 — forked from lcrilly/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
@attacus
attacus / riot-matrix-workshop.md
Last active April 8, 2025 08:18
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?