Skip to content

Instantly share code, notes, and snippets.

View tinacious's full-sized avatar
👩‍💻

Tina Holly tinacious

👩‍💻
View GitHub Profile
@tinacious
tinacious / Tinacious Design.json
Last active October 18, 2024 04:24
Zed editor theme and settings. Drop the "Tinacious Design.json" file into ~/.config/zed - See settings.json for configured overrides
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Tinacious Design",
"author": "Tina Holly",
"themes": [
{
"name": "Tinacious Design",
"appearance": "dark",
"style": {
"background": "#1D1D26",
@tinacious
tinacious / quick-dirty-dark-mode.user.js
Last active August 23, 2024 22:43
Quick && Dirty dark mode
// ==UserScript==
// @name Quick && Dirty dark mode
// @match https://leetcode.com/problems/*
// @grant none
// @version 1.0
// @author -
// @description 8/23/2024, 6:30:35 PM
// ==/UserScript==
document.body.style.filter = 'invert(1)'
@tinacious
tinacious / gitcleanup.sh
Created May 5, 2023 19:51
Bash function to add to your .bash_profile or .zshrc that collects git branches to be deleted via standard in
gitcleanup() {
echo 'Paste git branches to be deleted below then press enter...\n'
while read line
do
if [ -n "$line" ]; then
echo "\n"
git branch -D $line
echo "\n"
fi
done < "${1:-/dev/stdin}"
@tinacious
tinacious / health_controller.rb
Created February 18, 2022 23:07
A simple Ruby on Rails health check endpoint
# ./app/controllers/health_controller.rb
class HealthController < ApplicationController
skip_before_action :authenticate!
def index
current_time_str = ActiveRecord::Base.connection.execute("SELECT CURRENT_TIME;").first["current_time"]
current_time = current_time_str.to_datetime
render json: {
@tinacious
tinacious / Contents.swift
Created August 16, 2021 20:23
Making network requests in iOS with URLSession.
// Create a playground called NetworkingPlayground, e.g.
// ./NetworkingPlayground.playground/Contents.swift
import UIKit
/*
{
"id": 1,
"title": "Vinyl gloves",
"merchant": "Shoppers Drug Mart",
@tinacious
tinacious / add_openapi_docs_branding.rb
Created April 25, 2021 00:52
Adds branding to Swagger/Open API docs
#!/usr/local/bin/ruby
require 'json'
docs = File.read('spec/api_doc/v1/schemas/docs.json')
docs_json = JSON.parse(docs)
docs_json['info']['x-logo'] = {
"url": "https://example.com/logo.png",
"backgroundColor": "#ff3399"
}
@tinacious
tinacious / .rubocop.yml
Last active March 7, 2021 02:10
Ruby linter configuration
AllCops:
NewCops: enable
Exclude:
- 'db/**/*'
- 'vendor/**/*'
Layout/LineLength:
Max: 150
IgnoredPatterns: ['\#']
Exclude:
@tinacious
tinacious / android-permissions.ts
Last active December 27, 2020 05:06
Verify Android read/write permissions in React Native
import { PermissionsAndroid } from 'react-native';
import DeviceInfo from 'react-native-device-info';
/**
* Depending on the version of Android, we need to check different permissions
* to enable this functionality.
* Android Q and above only require read permission.
* Older versions require both read and write.
*
* Also make sure you have the following permissions in your manifest.
@tinacious
tinacious / __install_things.sh
Last active December 17, 2020 03:52
Some helpful tools to install
# Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew cask
brew install wget
# Node.js development
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
echo "nvm: Go here and add to your bash profile: https://github.com/nvm-sh/nvm";
@tinacious
tinacious / install_vscode_extensions.sh
Created December 17, 2020 02:07
A list of my installed Visual Studio Code extensions
code --install-extension aeschli.vscode-css-formatter
code --install-extension annsk.alignment
code --install-extension bierner.markdown-preview-github-styles
code --install-extension christian-kohler.npm-intellisense
code --install-extension christian-kohler.path-intellisense
code --install-extension dbaeumer.vscode-eslint
code --install-extension EditorConfig.EditorConfig
code --install-extension eg2.vscode-npm-script
code --install-extension fcrespo82.markdown-table-formatter
code --install-extension HookyQR.beautify