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
@clbarnes
clbarnes / source.sh
Created November 15, 2016 19:58
Enable completion for conda environments with `source activate ...`. Save in /etc/bash_completion.d/
# command: source
# Allow autocomplete for conda environments
_complete_source_activate_conda(){
if [ ${COMP_WORDS[COMP_CWORD-1]} != "activate" ]
then
return 0
fi
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(ls ~/anaconda3/envs | xargs -I dirs bash -c "compgen -W dirs $cur"))
@grabear
grabear / SILVA_walkthrough.R
Last active September 18, 2020 13:01
Parsing .biom files with SILVA formatted annotations using phyloseq
# This functionality has been tested and a PR has been pulled with phyloseq here:
# https://github.com/joey711/phyloseq/pull/854
#
# While the function has been vetted, the maintainers are very busy and the PR has not
# yet been added to the main package. Below i've added some detail to explain how to parse
# your silva data. It's quite easy....
source("parse_silva_taxonomy_128")
@Qixingchen
Qixingchen / config.toml
Created April 12, 2018 14:03
GitLab Runner for autoscaling with Docker Machine on Google preemptible VM
[[runners]]
name = "gce-main-scal"
url = ""
token = ""
executor = "docker+machine"
# 最大伸缩量
limit = 3
[runners.docker]
tls_verify = false
image = "ubnutu:16.04"
@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
@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;
@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() {
@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;
}
@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
@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.

@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);