Skip to content

Instantly share code, notes, and snippets.

View oogali's full-sized avatar

Omachonu Ogali oogali

  • Ordinary Stack
  • Princeton, NJ
  • 18:43 (UTC -04:00)
View GitHub Profile
@sebnyberg
sebnyberg / snippets.json
Created July 10, 2022 11:29
snippets.json
{
"TestCases": {
"prefix": "tcs",
"body": [
"func Test_$1(t *testing.T) {",
"\tfor _, tc := range []struct{",
"\t\t$2 $3",
"\t\twant $4",
"\t}{",
"\t\t{$0},",

babel-plugin-transform-mui-imports npm

A plugin to make authoring with MUI components efficient, both for humans and bundlers.

Here's why:

@toddlers
toddlers / golambda.sh
Created January 6, 2020 16:23
golang-lambda
mkdir helloworld
cd !$
go get github.com/aws/aws-lambda-go/lambda
GOOS=linux go build -o helloworld
aws iam create-role --role-name lambda-basic-execution
--assume-role-policy-document file://lambda-trust-policy.json
@ThomasLeister
ThomasLeister / rspamd-whitelisting.md
Last active March 20, 2024 19:31
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@hermanbanken
hermanbanken / Dockerfile
Last active April 22, 2024 10:53
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@steven2358
steven2358 / ffmpeg.md
Last active May 5, 2024 12:45
FFmpeg cheat sheet
@marcin-chwedczuk
marcin-chwedczuk / Main.java
Created November 18, 2017 14:36
Display values of MS-DOS Portable Executable header
// Needs Guava to compile:
//
// compile group: 'com.google.guava', name: 'guava', version: '23.4-jre'
//
import com.google.common.io.LittleEndianDataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
@martinhynar
martinhynar / zookeeper.service
Created June 2, 2017 10:56
ZooKeeper SystemD Service Unit File
[Unit]
Description=ZooKeeper Service
Documentation=http://zookeeper.apache.org
Requires=network.target
After=network.target
[Service]
Type=forking
User=zookeeper
Group=zookeeper
@matishsiao
matishsiao / pipe.go
Last active March 4, 2024 11:59
named pipe sample code
package main
import (
"bufio"
"fmt"
"log"
"os"
"syscall"
"time"
)
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 6, 2024 22:10
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.