Skip to content

Instantly share code, notes, and snippets.

View rusenask's full-sized avatar
🤔
why is there a status message field on github?

Karolis Rusenas rusenask

🤔
why is there a status message field on github?
View GitHub Profile
@hanxiao
hanxiao / testRegex.js
Last active November 6, 2024 13:03
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
[
{
"id": "gapp_1",
"name": "Uptime Kuma",
"description": "monitoring",
"website": "https://github.com/louislam/uptime-kuma",
"manifestUrl": "https://raw.githubusercontent.com/synpse-hq/synpse/feature/appstore/apps/uptime-kuma.yaml",
"tags": [],
"thumbnail": "https://raw.githubusercontent.com/louislam/uptime-kuma/master/public/icon.svg",
"author": "Louis Lam",
@viglesiasce
viglesiasce / greeter_server.py
Last active October 6, 2023 08:22
GKE gRPC Ingress
"""The Python implementation of the GRPC helloworld.Greeter server."""
from concurrent import futures
import time
import grpc
import helloworld_pb2
import helloworld_pb2_grpc
@DaisukeMiyamoto
DaisukeMiyamoto / assume_role.py
Created September 12, 2018 05:00
AWS Boto3 Assume Role example
import boto3
from boto3.session import Session
def assume_role(arn, session_name):
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role"""
client = boto3.client('sts')
account_id = client.get_caller_identity()["Account"]
print(account_id)
@alex-leonhardt
alex-leonhardt / main.go
Last active October 11, 2024 11:34
golang text/template with a map[string]interface{} populated from mixed json data
package main
import (
"encoding/json"
"os"
"reflect"
"text/template"
)
@wallyqs
wallyqs / nats-cluster-tls-kubernetes.org
Last active September 9, 2022 11:41
Secure NATS Cluster in Kubernetes

Secure NATS Cluster in Kubernetes

Creating the certificates

Generating the Root CA Certs

{
    "CN": "My Custom CA",
@samwhitehall
samwhitehall / apple-keyboard-ubuntu.md
Last active September 14, 2019 20:28
Apple Keyboard on Ubuntu 16.04
  1. use English (UK, Macintosh) as the base keyboard layout

  2. https://help.ubuntu.com/community/AppleKeyboard#Ubuntu_11.10_up_to_recent (steps 1,2,3) to fix wrong keys (§± and `~)

  3. dconf-editor org.gnome.desktop.input-sources.xkb-options ~> ['lv3:lalt_switch', 'lv3:ralt_alt']

  4. compizconfig-settings-manager (ccsm)

        desktop > ubuntu unity plugin > general > key to show the menu bar:     
@chantastic
chantastic / on-jsx.markdown
Last active September 17, 2024 16:40
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@magnetikonline
magnetikonline / README.md
Last active June 5, 2024 01:05
NSSM - the Non-Sucking Service Manager cheatsheet.
@mitchwongho
mitchwongho / Docker
Last active September 23, 2024 12:09
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash