Skip to content

Instantly share code, notes, and snippets.

@brand-it
brand-it / .irbrc
Last active November 7, 2023 06:39
.irbrc with a bunch of stuff I found useful. This is all sort of hacky but that kinda of the point. Do what you want take what you need. no need to be perfect
# frozen_string_literal: true
MAX_COLUMNS_FOR_TABLE = 15 unless defined?(MAX_COLUMNS_FOR_TABLE)
DEFAULT_EDITOR = 'code' unless defined?(DEFAULT_EDITOR)
class PrettyString < String
# https://no-color.org/
NO_COLOR = ENV.key?('NO_COLOR') || `tput colors`.chomp.to_i < 8 unless defined?(NO_COLOR)
unless defined?(ANSI_COLORS)
ANSI_COLORS = {
red: 31,
@karmatr0n
karmatr0n / .irbrc
Last active November 7, 2023 06:41
dotirbrc
require 'irb/completion'
require 'irb/ext/save-history'
require 'rubygems'
require 'irb/easter-egg' if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.7.0')
%w[awesome_print rainbow interative_editor virb].each do |gem|
next if Gem.loaded_specs.key?(gem)
if defined?(::Bundler)
system("rvm @global do gem install #{gem}")
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
@timhwang21
timhwang21 / missing_indexes.sql
Created July 23, 2020 04:05
Spotting missing indexes for MariaDB & MySQL
SELECT
t.TABLE_SCHEMA,
t.TABLE_NAME,
c.COLUMN_NAME,
IFNULL(
kcu.CONSTRAINT_NAME, 'Not indexed'
) AS `Index`
FROM
information_schema.TABLES t
INNER JOIN information_schema.`COLUMNS` c ON c.TABLE_SCHEMA = t.TABLE_SCHEMA
@sarmbruster
sarmbruster / run_docker_neo4j_bloom.sh
Last active October 3, 2024 07:10
Run Neo4j in a docker container together with apoc and Bloom installed.
#!/bin/sh
# start a neo4j docker container with apoc and bloom (server variant) configured
# this requires to have
# * curl, unzip and jq being installed
# * having a valid bloom license file
# released under the WTFPL (http://www.wtfpl.net/)
# (c) Stefan Armbruster
@robertcoopercode
robertcoopercode / .zshrc
Last active March 31, 2024 01:08
Zsh configuration file
#------------------
# Shell Variables
#------------------
# Specify VS Code as default editor for the React Native Simulator
export REACT_EDITOR=code-insiders
# Set VS Code Insiders as default code editor
export EDITOR=code-insiders
# Android SDK
export ANDROID_HOME=~/Library/Android/sdk
@mikowl
mikowl / myaliases.plugin.zsh
Last active September 15, 2025 18:47
My bash/zsh aliases
# My aliases
# Easier navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# ls stuff, most are set in lib/directories.zsh
# I use lsd (https://github.com/Peltoche/lsd) for certain listings
@jpryda
jpryda / scdc_rxcui_ndc.sql
Last active June 15, 2024 19:46
Mapping from RxNorm to NDC [Brand/Generic RXCUI (SCD/SBD/GPCK/BPCK) and SCDC Crosswalks]
/*
RxNorm SCDC and Brand/Generic RXCUI (SCD/SBD/GPCK/BPCK) to NDC Crosswalks
We care about semantically defined RxNorm normal forms for clinical/branded drugs and packs ONLY.
Certain NDCs that are associated with Non-RxNorm Concepts are ignored even though these may occur (infrequently) in real data.
e.g.
44946104501
50967031730
76439025810
CALL apoc.meta.data() YIELD label, property, type, elementType
WHERE elementType <> 'relationship'
AND type <> 'RELATIONSHIP'
WITH label, collect(property + ' (' + type + ')') AS properties
WITH apoc.map.fromLists(collect(label), collect(properties)) AS properties_map
CALL apoc.meta.graph() YIELD nodes, relationships
UNWIND nodes AS n
WITH n, apoc.node.labels(n)[0] AS label, properties_map, relationships
@gexclaude
gexclaude / NotepadPlusPlus_Omnimark_Syntax_Highlighting.xml
Created August 28, 2017 20:23
Simple Notepad++ OmniMark Syntax Highlighting File
<NotepadPlus>
<UserLang name="OmniMark" ext="ARG XAR XIN XMD XOM XOP">
<Settings>
<Global caseIgnored="yes" escapeChar="%" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&quot;&apos;0&quot;&apos;0</Keywords>
<Keywords name="Folder+"></Keywords>