Skip to content

Instantly share code, notes, and snippets.

@lukepighetti
lukepighetti / config.toml
Last active May 3, 2024 09:18
Helix – tree file picker... TODAY?!?
[keys.normal]
C-f = [":new", ":insert-output lf-pick", ":theme default", "select_all", "split_selection_on_newline", "goto_file", "goto_last_modified_file", ":buffer-close!", ":theme tokyonight_storm"]
@brandonjp
brandonjp / findOverflowParents.js
Last active May 3, 2024 09:17
find overflow:hidden ancestors
// when you're trying to use `position:sticky` on an element
// you'll have trouble if any parent/ancestor element has
// overflow set to anything other than "visible" (such as: auto,hidden,overlay,scroll)
// & turns out if a parent is `display:flex` it might need some love
// (to remedy this you can set the `align-self` of your sticky element)
// see here for how the display & align-self properties affect: http://bit.ly/2ZaRu4o
// so, to find those troublesome parents...
// copy & paste this into Chrome Inspector/Dev Tools console
// (and be sure to change the #stickyElement below, if needed)
vSphere 6 Enterprise Plus:
1C20K-4Z214-H84U1-T92EP-92838
1A2JU-DEH12-48460-CT956-AC84D
MC28R-4L006-484D1-VV8NK-C7R58
5C6TK-4C39J-48E00-PH0XH-828Q4
4A4X0-69HE3-M8548-6L1QK-1Y240
vSphere with Operations Management 6 Enterprise:
4Y2NU-4Z301-085C8-M18EP-2K8M8
1Y48R-0EJEK-084R0-GK9XM-23R52
@tovBender
tovBender / gist:f185e7c1e6455721732dee540d0fc479
Last active May 3, 2024 09:08
MODX -- AJAX-подгрузка статей кнопкой с помощью pdoPage
<div class="news-items" id="newsItems">
[[!+news-nav]]
<div class="rows" style="overflow: hidden;">
[[!pdoPage?
&parents=`18`
&tpl=`newItemTpl`
&showHidden=`1`
&includeTVs=`image`
&limit=`4`
&sortby=`{"publishedon":"ASC"}`
@brentjanderson
brentjanderson / Howto.md
Created February 20, 2018 17:55
SSH Tunneling with Firefox

Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).

  1. Open a terminal
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@yudistiraashadi
yudistiraashadi / supabase_sync.md
Last active May 3, 2024 09:05
Sync supabase online - local - self host (3 way)

1. Requirement

  • Terdapat Supabase instance di online / local / self host (salah satu)
  • Ter install node.js serta Docker pada mesin local

 

2. Sync ke local

Step ini dilakukan apabila supabase ada di online / self host. Step ini dapat di skip apabila sudah ada di local.

  • Pada directory yang anda inginkan, run npx supabase init untuk setup supabase folder dan config.
@dipankardas011
dipankardas011 / main.go
Last active May 3, 2024 09:05
Without kubernetes service exposed how to get http client connect?
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
"net/http"
"os"
@yudistiraashadi
yudistiraashadi / supabase_sync_sat_set.md
Created May 3, 2024 09:01
Sync Supabase command e tok

RUN DI LOCAL:

  1. npx supabase init untuk setup supabase folder dan config.
  2. npx supabase start untuk setup Docker (download docker image + setup)
  3. npx supabase db diff -f initial_structure --db-url [connection-string-asal]
  4. npx supabase db diff -f initial_structure --db-url [connection-string-asal] --schema auth,storage
  5. npx supabase db dump --data-only -f supabase/seed.sql --db-url [connection-string-asal]
  6. npx supabase db reset --db-url [connection-string-tujuan]
@rwightman
rwightman / median_pool.py
Last active May 3, 2024 09:03
PyTorch MedianPool (MedianFilter)
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair, _quadruple
class MedianPool2d(nn.Module):
""" Median pool (usable as median filter when stride=1) module.