Skip to content

Instantly share code, notes, and snippets.

View samos123's full-sized avatar
🎯
Focusing

Sam Stoelinga samos123

🎯
Focusing
View GitHub Profile
Type your search: What is Germany?
(Document(page_content="Germany has been described as a [[great power]] with [[Economy of Germany|a strong economy]]; it has the [[List of sovereign states in Europe by GDP (nominal)|largest economy in Europe]], the world's [[List of countries by GDP (nominal)|fourth-largest economy by nominal GDP]] and the [[List of countries by GDP (PPP)|fifth-largest by PPP]]. As a global power in industrial, [[Science and technology in Germany|scientific and technological]] sectors, it is both the world's [[List of countries by exports|third-largest exporter]] and [[List of countries by imports|importer]]. As a [[developed country]] it [[Social security in Germany|offers social security]], [[Healthcare in Germany|a universal health care system]] and [[Higher education in Germany|a tuition-free university education]]. Germany is a member of the [[United Nations]], the European Union, [[NATO]], the [[Council of Europe]], the [[G7]], the [[G20]] and the [[OECD]]. It has the [[List of World
@cjavilla-stripe
cjavilla-stripe / webhooks.tsx
Created March 25, 2022 13:11
Handle Stripe webhooks in Remix
import Stripe from 'stripe'
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY)
export const action = async ({request}) => {
const secret = 'whsec_...' // process.env.WEBHOOK_SIGNING_SECRET
const sig = request.headers.get('stripe-signature')
let event;
const payload = await request.text()
@TheRealFlyingCoder
TheRealFlyingCoder / Cloud Run & Remix
Last active March 19, 2024 17:58
Remix & Cloud Run
So you want to set up remix in cloud run huh? It's pretty simple but i'm going to assume you can figure out most of the GCP UI on your own.
Cloud Run:
Step 1: Create a new service and take note of the service ID
Step 2: Allow all traffic in the /triggers tab
Cloud Build:
Step 1: Set up a Cloud Build trigger on your repo
Step 2: Point the configuration to "cloud build configuration file" at the root of your project
Step 3: Add the following to the substitution variables (so you can keep it safe):
@lpillmann
lpillmann / read_parquet.py
Last active November 16, 2023 05:52
Read partitioned parquet files into pandas DataFrame from Google Cloud Storage using PyArrow
import gcsfs
import pyarrow
def read_parquet(gs_directory_path, to_pandas=True):
"""
Reads multiple (partitioned) parquet files from a GS directory
e.g. 'gs://<bucket>/<directory>' (without ending /)
"""
gs = gcsfs.GCSFileSystem()
arrow_df = pyarrow.parquet.ParquetDataset(gs_directory_path, filesystem=gs)
@Julian-Nash
Julian-Nash / flask_sitemap_generator.py
Last active May 4, 2024 13:03
Flask dynamic sitemap generator
@app.route("/sitemap")
@app.route("/sitemap/")
@app.route("/sitemap.xml")
def sitemap():
"""
Route to dynamically generate a sitemap of your website/application.
lastmod and priority tags omitted on static pages.
lastmod included on dynamic content such as blog posts.
"""
from flask import make_response, request, render_template
@sethvargo
sethvargo / create-certs.sh
Created June 6, 2018 16:20
Use openssl to create an x509 self-signed certificate authority (CA), certificate signing request (CSR), and resulting private key with IP SAN and DNS SAN
# Define where to store the generated certs and metadata.
DIR="$(pwd)/tls"
# Optional: Ensure the target directory exists and is empty.
rm -rf "${DIR}"
mkdir -p "${DIR}"
# Create the openssl configuration file. This is used for both generating
# the certificate as well as for specifying the extensions. It aims in favor
# of automation, so the DN is encoding and not prompted.
@ArthurX
ArthurX / copy_recording_to_storage.py
Created April 29, 2016 10:58
Small script to copy audio recording files made with non-timeline to a new date named directory and create a new empty setup to start
#!/usr/bin/python -tt
# Small script to copy audio recording files made with non-timeline to a new date named directory and create a new empty setup to start. You can change the recorded file size limit.
# You need to create the working and preset directories before.
# I use rename() because that is way quicker than really copying.
import sys
import re
import os
import shutil
This document describes about installation and configuration of IPMI simulator.
We need: qemu-kvm, OpenIPMI, OpenIPMI-tools
1) Install the qemu-kvm. We need the qemu, which have the IPMI pacthes.
Use the source https://github.com/cminyard/qemu/tree/stable-2.2-ipmi
./configure, make and make install
2) Download the OpenIPMI libraries, from http://sourceforge.net/projects/openipmi/
Follow the process documented in lanserv/README.vm
./configure --prefix=/opt/openipmi/usr --sysconfdir=/opt/openipmi/etc \
--with-perlinstall=/opt/openipmi/usr/lib/perl \
@jin3110
jin3110 / tmux.sh
Last active January 8, 2024 12:33
How to install tmux in CoreOS toolbox
#!/bin/bash
# Usage
# =====
# ~~~
# /opt/bin/tmux.sh [tmux args...]
# ~~~
#
# How to install tmux in CoreOS toolbox
# =====================================
@JustinCarmony
JustinCarmony / example_output.txt
Created July 30, 2014 20:24
Summary Salt Highstate Outputter
root@deployServer:~# salt \* state.highstate --output=summary_highstate
web-server01.example.com ------------------ Success: 20 Changed: 0 Errors: 0
web-server02.example.com ------------------ Success: 71 Changed: 1 Errors: 0
db-server03.example.com ------------------- Success: 73 Changed: 1 Errors: 0
mongo-server04.example.com ---------------- Success: 74 Changed: 1 Errors: 0
mongo-server05.example.com ---------------- Success: 74 Changed: 1 Errors: 0
memcache-server06.example.com ------------- Success: 74 Changed: 1 Errors: 0
mysql-server07.example.com ---------------- Success: 74 Changed: 1 Errors: 0
logs-server08.example.com ----------------- Success: 20 Changed: 0 Errors: 0
redis-server09.example.com ---------------- Success: 27 Changed: 0 Errors: 0