Skip to content

Instantly share code, notes, and snippets.

View chew-z's full-sized avatar

Robert J. chew-z

  • Warsaw, Poland
View GitHub Profile
@bitingsock
bitingsock / cycle-adevice.lua
Last active May 17, 2024 12:24
Cycle through available audio devices with key binds(shift+a,ctrl+a). Change "wasapi" on line 1 to your relevant audio api.
local api = "wasapi"
local deviceList = mp.get_property_native("audio-device-list")
local aid = 1
local function cycle_adevice(s, e, d)
mp.enable_messages("error")
while s ~= e + d do -- until the loop would cycle back to the number we started on
if string.find(mp.get_property("audio-device"), deviceList[s].name, 1, true) then
while true do
if s + d == 0 then --the device list starts at 1; 0 means we iterated to far
s = #deviceList + 1 --so lets restart at the last device
@zombiezen
zombiezen / .profile
Last active November 15, 2023 07:34
zsh on Google Cloud Shell
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@ahmetb
ahmetb / gcrgc.sh
Last active March 10, 2025 21:51
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@masklinn
masklinn / cheatsheet.md
Last active April 17, 2025 02:20
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

@eddiewebb
eddiewebb / readme.md
Last active May 12, 2025 09:35
Hugo JS Searching with Fuse.js
@The-King-of-Toasters
The-King-of-Toasters / mbsync.vim
Last active August 10, 2019 04:45
Vim Syntax Highlighting for mbsyncrc
" Vim syntax file
" Language: mbsync setup files
" Maintainer: Stephen Gregoratto <[email protected]>
" Last Change: 2018-03-13
" Filenames: mbsyncrc
" Version: 0.2
" Licence: GPLv3+
"
" Note: This config borrows heavily from msmtprc.vim
" by Simon Ruderich and Eric Pruitt
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active May 12, 2025 05:32
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@ujjkumsi
ujjkumsi / dialogflow.go
Created May 9, 2018 14:14
Using dialog flow v2 sdk for go
package main
import (
"context"
"errors"
"fmt"
"log"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
@rrcfesc
rrcfesc / letsencrypt_2018.md
Created July 26, 2018 17:23 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@kleo
kleo / install.md
Last active February 7, 2021 15:28 — forked from rsandrade/install_go_pi.sh
Install Go 1.15.3 on Raspberry Pi

Install Go 1.15.3 on Raspberry Pi

  1. yeet this into your terminal
sh -c "$(curl -fsSL https://gist.githubusercontent.com/kbeflo/9d981573aad107da6fa7ac0603259b3b/raw/35111746659e6146d4985e0ab451c023415f5f1b/install.sh)"
  1. logout
  2. login