Skip to content

Instantly share code, notes, and snippets.

@dominickm
dominickm / .rubocop.yml
Created January 2, 2024 02:58
My Rubocop because I am a grumpy old man lol
require: rubocop-rails
Rails/UniqueValidationWithoutIndex:
Enabled: false
Rails/SkipsModelValidations:
Enabled: false
Rails/SaveBang:
Enabled: false
@dominickm
dominickm / gungan.py
Created October 4, 2021 11:53
Python Sample for CR 343
from __future__ import annotations
class Gungan():
__instance = None
# whatever our particular hero does
def __init__(self) -> None:
# whatever config you want to do here
Gungan.__instance = self
@dominickm
dominickm / .vimrc
Last active October 9, 2020 11:56
.vimrc
call plug#begin()
Plug 'preservim/NERDTree'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-endwise'
Plug 'dense-analysis/ale'
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
@dominickm
dominickm / MSHub.swift
Created June 4, 2018 15:38
MSHub.swift
import UIKit
extension Github {
var clippy: String {
return "To continue using Github, please install Edge."
}
}
let sadness = Github.clippy
@dominickm
dominickm / Gungan.swift
Last active October 24, 2017 05:55
Coder Radio 280: 1
// for Coder Radio 280
//: Playground - noun: a place where people can play
import UIKit
class Gungan {
var name: String = "" // I am not optional, so I must have an initializer
var fifthGradeDiploma: String? // I, sadly, am an optional
func greet(jedi: String) -> String {
@dominickm
dominickm / slack_bot.js
Last active June 16, 2017 00:01
Botkit Sample SR 261
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a sample Slack bot built with Botkit.
This bot demonstrates many of the core features of Botkit:
* Connect to Slack using the real time API
* Receive messages based on "spoken" patterns
* Reply to messages
@dominickm
dominickm / git-replace.sh
Created April 25, 2017 13:52
Removes instances of one user and replaces them with another in a Git history
DEFAULT_NAME="$(git config user.name)"
DEFAULT_EMAIL="$(git config user.email)"
export OLD_NAME="${1:-$DEFAULT_NAME}"
export NEW_NAME="${2:-$DEFAULT_NAME}"
export NEW_EMAIL="${3:-$DEFAULT_EMAIL}"
echo "Old:" $OLD_NAME "<*>"
echo "New:" "$NEW_NAME <$NEW_EMAIL>"
echo "To undo, use: git reset $(git rev-parse HEAD)"
@dominickm
dominickm / keystore_alias_finder.rb
Created April 11, 2017 13:46
A Simple Ruby that gets an alias name out of a Java keystore file. Requires the Java keystore tools to be installed on the system. Works on Mac and Linux
keystore_file = ARGV[0]
if keystore_file
cmd = 'keytool -list -v -keystore' + ' ' + keystore_file + '| grep "Alias name\|Creation date"'
puts system(cmd)
else
puts 'please pass in a keystore file'
end
@dominickm
dominickm / UIAlertfail.m
Last active September 19, 2016 01:48
UIAlert Fail
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Erorr" message:@"All fields are required." delegate:self cancelButtonTitle:self otherButtonTitles:nil];
// This is meant to go along with Coder Radio Episode 204
// Optional types in Swift 101
struct JarJar {
var senateSpeach: String? // the '?' means messa might be nil and makes me an Optional type
func voteOfNoConfidence() {
// attempting to use the senateSpeach var but not setting it's value
let isSith = senateSpeach?.containsString("something something darkside") // senateSpeach is nil