Skip to content

Instantly share code, notes, and snippets.

View miguelfbrito's full-sized avatar

Miguel Brito miguelfbrito

View GitHub Profile
# /Users/xxx/Library/Application Support/k9s/hotkey.yml
hotKey:
# Hitting Shift-0 navigates to your CNPG clusters
shift-Q:
shortCut: Shift-Q
description: Viewing CNPG clusters
command: postgresql.cnpg.io/v1/clusters
@robsalgado
robsalgado / auto_topic_selection.py
Last active June 27, 2020 11:06
Automatic Topic Selection
# Use Gensim's NMF to get the best num of topics via coherence score
texts = df['processed_text']
# Create a dictionary
# In gensim a dictionary is a mapping between words and their integer id
dictionary = Dictionary(texts)
# Filter out extremes to limit the number of features
dictionary.filter_extremes(
no_below=3,
@ageis
ageis / .bashrc 02-25-2020
Last active February 14, 2026 11:36
@ageis's ~/.bashrc 🖥️ with numerous useful functions, aliases and one-liners. ⚠️ NOTE: many paths in sourced scripts and environment variables are specific to my system, but if you dig in I hope you'll find something you can use!
#!/bin/bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# kevin gallagher (@ageis) <kevingallagher@gmail.com>
# normally I divide this into separate files: .bashrc, .bash_profile, .bash_aliases and .bash_functions (also .bash_logout), but it's all concatenated here.
ulimit -s unlimited
export MYUID=$(id -u)
export USER="$(id -un)"
if [[ "$TILIX_ID" ]] || [[ "$VTE_VERSION" ]]; then
@eltonvs
eltonvs / arch_installation.md
Last active February 14, 2026 15:09
Arch Linux step to step installation guide

Arch Linux Installation Guide

This guide will show step-by-step how to Install Arch Linux on UEFI mode.

Table of Contents

  • Bootable Flash Drive
  • BIOS
  • Pre installation
    • Set Keyboard Layout
    • Check boot mode
  • Update System Clock
@pauloromeira
pauloromeira / tlp
Last active December 3, 2025 14:27
My TLP config file (/etc/default/tlp) for ThinkPad
# ------------------------------------------------------------------------------
# tlp - Parameters for power saving
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
# dir: /etc/default/tlp
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
@DylanKojiCheslin
DylanKojiCheslin / sinon-ut-cheat-sheet.md
Last active October 26, 2025 00:18 — forked from yoavniran/ultimate-ut-cheat-sheet.md
a Sinon Unit Testing Cheat-sheet
@AloofBuddha
AloofBuddha / associations.md
Last active December 21, 2025 15:33
Sequelize Relationships: hasOne vs belongsTo
@theankitgaurav
theankitgaurav / functionalArrayMethods.md
Created November 4, 2016 16:37
JavaScript Map, Filter, Reduce methods Cheatsheet

map()

Use it when: You want to translate/map all elements in an array to another set of values.

Example: convert Fahrenheit temps to Celsius.

var fahrenheit = [0, 32, 45, 50, 75, 80, 99, 120];

var celcius = fahrenheit.map(function(elem) {
@jeongho
jeongho / graphite_collectd.txt
Created February 4, 2016 18:08
graphite+collectd on Centos
yum list installed | grep -i "graphite\|carbon\|whisper"
graphite-web.noarch 0.9.12-5.el6 @epel
graphite-web-selinux.noarch 0.9.12-5.el6 @epel
python-carbon.noarch 0.9.12-3.el6.1 @epel
python-whisper.noarch 0.9.12-1.el6 @epel
Graphite Install
1. Install dependencies
ansible-playbook -i hosts update_yum.yml
@manuelbieh
manuelbieh / sequelize-migration-file-generator.js
Created January 14, 2016 16:42
Creates migration files for existing sequelize models
import * as models from "models";
import fs from "fs";
for(let model in models) {
let attributes = models[model].attributes;
for(let column in attributes) {
delete attributes[column].Model;
delete attributes[column].fieldName;