Skip to content

Instantly share code, notes, and snippets.

View leonardonormando's full-sized avatar

Leonardo Normando leonardonormando

  • eureka!
  • Brazil, Ceara, Fortaleza
View GitHub Profile
@P7h
P7h / tmux_vs_screen.md
Last active May 8, 2024 17:00
tmux vs screen commands

tmux vs. screen commands


Action tmux screen
start a new session tmux
tmux new
tmux new-session
screen
start a new session with a name tmux new -s name screen -S name
re-attach a detached session tmux attach
tmux attach-session
screen -r
re-attach a detached session with a name tmux attach -t name
tmux a -t name
screen -r name
re-attach an attached session (detaching it from elsewhere) tmux attach -dtmux attach-session -d screen -dr
@ctechols
ctechols / compinit.zsh
Last active April 19, 2024 23:44
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active April 16, 2024 10:42
Byte formatting for Google Sheets
@mderazon
mderazon / export-to-csv.gs
Last active April 2, 2024 22:25
Google apps script to export to individual csv files all sheets in an open spreadsheet
/*
* script to export data in all sheets in the current spreadsheet as individual csv files
* files will be named according to the name of the sheet
* author: Michael Derazon
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}];
ss.addMenu("csv", csvMenuEntries);
@jamonholmgren
jamonholmgren / minecraft-child-account.md
Last active March 23, 2024 16:21
Minecraft, fixing the "Multiplayer is disabled. Please check your Microsoft account settings." frustrating issue

I have a Microsoft Family account and have my daughter as one of the family members.

Whenever she tries to play Minecraft (Java Edition) with us, it pops up something like the following:

"Multiplayer is disabled. Please check your Microsoft account settings."

I tried all kinds of things found online. They kept saying to go to the Xbox Privacy and online safety screen, but I couldn't find the "You can play with people outside of Xbox Live" and "You can join multiplayer games" settings. Well, that's because I needed to click on the "Xbox Series ... and Windows 10 devices Online Safety" tab.

Here's a direct link. You will need to replace the "GAMERTAGHERE" with your child's gamer tag. You need to be logged in under your (parental) account, not the child's.

@ahmetb
ahmetb / gcrgc.sh
Last active February 26, 2024 09:14
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
@jameskoster
jameskoster / functions.php
Last active November 21, 2023 11:32
WooCommerce - change number of products displayed per page
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 );
function new_loop_shop_per_page( $cols ) {
// $cols contains the current number of products per page based on the value stored on Options -> Reading
// Return the number of products you wanna show per page.
$cols = 9;
return $cols;
}
@shamil
shamil / rundeck_executions_cleanup.sh
Last active March 24, 2023 20:02
Rundeck executions cleanup
#!/bin/bash -e
# see related issue: https://github.com/rundeck/rundeck/issues/357
# export required vars
export RD_URL=http://localhost:4440 RD_USER=admin RD_PASSWORD=admin RD_HTTP_TIMEOUT=300
# make sure rd & jq commands are in the PATH
which -- rd jq >/dev/null
del_executions() {
@vdjurovic
vdjurovic / page.css
Created November 18, 2015 06:58
HTML/CSS to simulate A4 pagr printing view
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-color: #FAFAFA;
font: 12pt "Tahoma";
}
* {
box-sizing: border-box;
@phawk
phawk / .screenrc
Last active November 8, 2021 01:49
Sample screenrc
# Save this in ~/.screenrc
# Use bash
shell /bin/bash
autodetach on
# Big scrollback
defscrollback 5000