Skip to content

Instantly share code, notes, and snippets.

View wzulfikar's full-sized avatar
💭
Set status

Wildan Zulfikar wzulfikar

💭
Set status
View GitHub Profile
@nandorojo
nandorojo / README.md
Last active December 23, 2022 23:03
Expo + Next.js Query Param state

Expo + Next.js Query Params State 🦦

A typical use-case on web for maintaining React State is your URL's query parameters. It lets users refresh pages & share links without losing their spot in your app.

URL-as-state is especially useful on Next.js, since next/router will re-render your page with shallow navigation.

This gist lets you leverage the power of URL-as-state, while providing a fallback to React state for usage in React Native apps.

It's essentially a replacement for useState.

@userdocs
userdocs / authelia_nginx.md
Last active April 24, 2024 13:20
A simplified Authelia nginx reverse proxy configuration

Nginx

nginx is a reverse proxy supported by Authelia.

Configuration

We will be working with these files.

/etc/nginx/authelia.conf
@wlib
wlib / LICENSE
Last active June 10, 2022 22:14
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@dceddia
dceddia / CGPath+svg.swift
Last active July 19, 2023 14:51
Convert a CGPath to an SVG element with this Swift extension to CGPath
//
// CGPath+svg.swift
//
// Create an SVG element from a CGPath.
//
// Created by Dave Ceddia.
// MIT Licensed
//
// Inspired by: https://github.com/mro/MROGeometry/blob/master/MROGeometry/CGPathWriter.c
@DmitryTsepelev
DmitryTsepelev / 1_graphql_ruby_n_plus_one.md
Last active January 5, 2024 15:16
N+1 in graphql-ruby

How to run examples:

  1. Run $ createdb nplusonedb to create DB
  2. Run specs $ rspec demo.rb
@JoshuaMorris
JoshuaMorris / readme.md
Last active March 14, 2024 00:46
Pwnagotchi setup details

Welcome to your new Pwnagotchi

Congratulations on the purchase of your Pwnagotchi.

I have put this device together for you and tested to make sure it is operating as expected.

What is it?

Pwnagotchi is an A2C-based “AI” powered by bettercap and running on a Raspberry Pi Zero W that learns from its surrounding WiFi environment in order to maximize the crackable WPA key material it captures (either through passive sniffing or by performing deauthentication and association attacks). This material is collected on disk as PCAP files containing any form of handshake supported by hashcat, including full and half WPA handshakes as well as [PMKIDs](https://www.evilsocket.net/2019/02/13/Pwning-WiFi-networks-with-bettercap-an

Boolean() or !! (double bang, double negation)?

What's the best way to answer the question "true or false?" in JavaScript

JavaScript does not bother you too much with types (at first), which is both a blessing and a cure. But we all know the Boolean type. Boolean variables can either be true or false. Yes or no.

Every value in JavaScript can be translated into a boolean, true or false. Values that translate to true are truthy, values that translate to false are falsy. Simple.

This is about two ways to make that translation.

@iffa
iffa / postgis.json
Last active December 30, 2022 06:06
CapRover template for PostGIS
{
"captainVersion": "2",
"documentation": "https://hub.docker.com/r/postgis/postgis",
"displayName": "Postgres with PostGIS",
"description": "PostGIS is a spatial database extender for PostgreSQL object-relational database.",
"dockerCompose": {
"version": "3.3",
"services": {
"$$cap_appname-db": {
"image": "postgis/postgis:$$cap_postgres_version",
@tadast
tadast / ruby.yml
Created April 26, 2020 20:29
Example github actions config for Rails with postgres using DATABASE_URL
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@KATT
KATT / favourite-ts-tricks.md
Last active July 26, 2023 06:16
🧙‍♂️ Favourite non-obvious TS tricks

Record<string, x | undefined>

Represent maps

// rather than 
const map: {[ key: string ]: string} = {
  foo: 'bar',
}