Skip to content

Instantly share code, notes, and snippets.

View mkhairi's full-sized avatar
🤜
Hello, Nice to meet you

Khairi Adnan mkhairi

🤜
Hello, Nice to meet you
View GitHub Profile
@CharlesGodwin
CharlesGodwin / cloudflare.md
Last active April 29, 2024 12:49
I Don't Need Port Forwarding and Don't Care About CGNAT

I Don't Need Port Forwarding and Don't Care About CGNAT

This was rewritten 2022-11-30

This article is for users that want all these features:

  • To connect to home network from anywhere
  • Can connect without any port forwarding; either by choice or internet provider can't or won't provide access
  • No setup or configuration or installation on client machine
  • No enrolment / registration required
@leastbad
leastbad / README.md
Created April 16, 2020 08:08
Choices.js Stimulus wrapper preview

Choices.js Stimulus wrapper

https://joshuajohnson.co.uk/Choices/

Soon, this will be published as an NPM package, but there's an absence of documentation right now. It supports almost all functions from the original library; soon it will support 100% of them.

This wrapper adds Ajax pre-fetch search. Happens if controller has a data-search-path attribute.

Stimulus controller targets use new v2 syntax. Controller attaches a reference to itself on the element so that you can access the internal state from external scripts.

@leastbad
leastbad / autosize_controller.js
Created February 6, 2020 02:09
My autosize implementation
import { Controller } from 'stimulus'
export default class extends Controller {
initialize () {
this.setInputAttributes()
this.update()
}
update () {
this.element.style.height = 'auto'
@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active June 24, 2024 07:35
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@adrobinoga
adrobinoga / multiple_realtime.py
Last active March 8, 2024 08:51
test script to read realtime events from multiple zkteco devices
import time
import datetime
from utils import *
import pyzk.pyzk as pyzk
from pyzk.zkmodules.defs import *
from pyzk.misc import *
"""
Script to connect to multiple ZKTeco devices and check the incoming events by pooling.
@disintegrator
disintegrator / https-during-dev.macos.sh
Last active June 18, 2024 13:40
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {
@zingmars
zingmars / tinc.MD
Last active March 14, 2024 12:02
tinc VPN setup instructions on Windows and Linux

Tinc setup instructions for Ubuntu and Windows. Based on 1 2.

Start here.

  1. sudo apt-get install -y build-essential libncurses5-dev libreadline6-dev libzlcore-dev zlib1g-dev liblzo2-dev libssl-dev
  2. Download and install tinc
    2.1. Download the latest tinc 1.1 source package ( current: wget https://www.tinc-vpn.org/packages/tinc-1.1pre16.tar.gz -O tinc.tar.gz)
    • tar -xf tinc.tar.gz --one-top-level --strip-components=1
    • cd tinc
    • ./configure
@maxivak
maxivak / webpacker_rails.md
Last active June 15, 2024 21:37
Webpack, Yarn, Npm in Rails
@andyyou
andyyou / rails_webpacker_bootstrap_expose_jquery.md
Last active August 9, 2022 07:38
Rails 5.2 with webpacker, bootstrap, stimulus starter

Rails 5.2 with webpacker, bootstrap, stimulus starter

This gist will collects all issues we solved with Rails 5.2 and Webpacker

Create Project

# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
@mrmartineau
mrmartineau / stimulus.md
Last active May 12, 2024 04:35
Stimulus cheatsheet