Skip to content

Instantly share code, notes, and snippets.

@FradSer
FradSer / iterm2_switch_automatic.md
Last active May 3, 2024 19:58
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@danrovito
danrovito / countrydropdown.html
Last active May 3, 2024 19:57
HTML Country Select Dropdown List
<label for="country">Country</label><span style="color: red !important; display: inline; float: none;">*</span>
<select id="country" name="country" class="form-control">
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
@dhh
dhh / linux-setup.sh
Last active May 3, 2024 19:56
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@shoui520
shoui520 / readmore.md
Last active May 3, 2024 19:56
Chinese Yomichan Setup

Yomichan setup for Chinese

https://learnjapanese.moe

Yomichan is a browser extension created for Japanese which enables its users to quickly and efficiently look up words on a webpage.
While it is made for Japanese, it is possible to use it for other languages, including Chinese.

Getting Yomichan

Yomichan is available for both Chromium and Firefox based browsers. You can find the respective versions below.

/* CHAT STYLES */
* {
font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
letter-spacing: 0.5px;
}
.ce-chat-list {
background-color: rgb(240, 240, 240) !important;
/* CHAT STYLES */
* {
font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
letter-spacing: 0.5px;
}
.ce-chat-list {
background-color: rgb(240, 240, 240) !important;
@gayathrics
gayathrics / facetwp-selections-html.js
Created April 13, 2018 17:45
use this snippet to customize the facetwp selections html markup
//reference: \wp-content\plugins\facetwp\assets\js\front.js - Generate the user selections
wp.hooks.addAction('facetwp/loaded', function () {
// add custom code here
var selections = '';
jQuery.each(FWP.facets, function (key, val) {
if (val.length < 1 || 'undefined' === typeof FWP.settings.labels[key]) {
return true; // skip this facet
}
var choices = val;
@BenHerbst
BenHerbst / WireGuard-site-to-site.md
Created May 3, 2024 19:53 — forked from insdavm/WireGuard-site-to-site.md
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

// Facetwp A11Y Pager
function fs_a11y_facetwp_pager_html( $output, $params ) {
$output = '';
$page = $params['page'];
$total_pages = $params['total_pages'];
if ( 1 < $total_pages ) {
@insdavm
insdavm / WireGuard-site-to-site.md
Last active May 3, 2024 19:53
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary