Skip to content

Instantly share code, notes, and snippets.

View kenjij's full-sized avatar
👨‍💻
Hacking away...

Ken J. kenjij

👨‍💻
Hacking away...
View GitHub Profile
@kenjij
kenjij / textmate-fontsmoothing.sh
Created August 22, 2015 03:24
Font smoothing control in TextMate
# Change settings below if font renderings appear to thin or bold.
# 0: Always disabled.
# 1: Always enabled.
# 2: Disabled for dark themes.
# 3: Disabled for dark themes on high-DPI displays (default).
# Generaly, set the value to 1 if renderings appear too thin
defaults write com.macromates.TextMate.preview fontSmoothing 1
# Reset to default
@kenjij
kenjij / update.sh
Last active February 16, 2016 06:38
Create New Host from Ubuntu Backup Image
# Better to be root
sudo bash
# Change IP address (static)
nano /etc/network/interfaces
# Update hostnames
nano /etc/hostname
nano /etc/hosts
@kenjij
kenjij / build.sh
Created November 17, 2016 18:53
Compiling Reactjs/JSX using Babel
# Usage:
# - Install npm
# - Configure package.json
# - Place source code in "src/"
# - Outputs to "app.js"
npm run build
@kenjij
kenjij / slack_formatting.md
Created December 28, 2016 08:58
Slack message formatting to be used with their API

Slack Message Formatting Reference

Text Formatting

Basic Styles

Making a *bold statement.*
Emphasis with _italic text._
Let's ~strike out~ post this message.
@kenjij
kenjij / CHANGELOG.md
Created December 29, 2016 09:12
A change log template

1.0.0 / Unreleased

Added

  • Version followed by release date.
  • Maintain "Unreleased" version in draft in preparation for release.
  • "Added" section for new features added.
  • MAJOR increment in semantic versioning would mean incompatible changes.

Changed

@kenjij
kenjij / clean-sidekiq-stats.sh
Created January 11, 2017 05:05
Clean up Sidekiq stats in Redis
redis-cli KEYS "Sidekiq:*:stat:processed:*" | xargs -n 100 redis-cli DEL
@kenjij
kenjij / rvm_admin.sh
Created January 21, 2017 00:24
RVM administration
# See: https://rvm.io/rvm/install
# Install public key
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
# Single-user install
\curl -sSL https://get.rvm.io | bash -s stable --ruby
# Multi-user install; after install, add users to "rvm" group
\curl -sSL https://get.rvm.io | sudo bash -s stable
@kenjij
kenjij / keys_to_sym.rb
Created January 21, 2017 01:16
Ruby: iterate through nested object and replace keys (convert to symbol)
# Convert all Hash keys to lowercase symbols
# @param obj [Object] any Ruby object
def keys_to_sym(obj)
case obj
when Array
obj.each do |v|
keys_to_sym(v)
end
when Hash
obj.keys.each do |k|
@kenjij
kenjij / load.rb
Created March 23, 2017 18:16
Load files from list of directories in Ruby
def load_from_path(path)
Dir.chdir(path) {
Dir.foreach('.') { |f| load f unless File.directory?(f) }
}
end
paths = [
'conf.d',
'plugins'
]
@kenjij
kenjij / Firebase.md
Last active May 24, 2024 14:02
Firebase REST authentication