Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tomfast's full-sized avatar

Tom Fast tomfast

View GitHub Profile
@jthodge
jthodge / universal-switcher
Created September 6, 2020 22:07
Show macOS app switcher across all monitors
defaults write com.apple.Dock appswitcher-all-displays -bool true
killall Dock
@jeffkreeftmeijer
jeffkreeftmeijer / 1.png
Last active November 3, 2023 00:56
Ruby image diff
1.png
@bkeating
bkeating / howto-filemerge-git-osx.md
Created March 11, 2010 21:36
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@kivanio
kivanio / token.rb
Created December 22, 2016 17:53 — forked from GregBaugues/token.rb
Google API OAuth 2.0 refresh token (Ruby on Rails)
# The OAuth access token provided by the Google API expires in 60 minutes. After expiration,
# you must exchange a refresh token for a new access token. Unfortunately, the the Google API
# ruby gem does not include a method for refreshing access tokens.
# You can read up on how to refresh an access token here:
# https://developers.google.com/accounts/docs/OAuth2WebServer#refresh
# This Token model implements that process. It's based off of a Token model that can be created
# by running:
# rails g model Token token:text refresh_token:string expires_at:datetime
@bschaeffer
bschaeffer / migration.rb
Last active February 23, 2021 19:35
Mass update counter cache columns (with Rails references)
class UpdateCounters < ActiveRecord::Migration
def up
say_with_time 'Updating counter_cache_column for ModelWithColumn' do
ActiveRecord::Base.connection.execute <<-SQL
UPDATE model_with_column
SET counter_cache_column = (
SELECT COUNT(*)
FROM model_with_counter_cache
WHERE model_with_counter_cache.reference = model_with_column.id
)
# recent xcode
# http://developer.apple.com/technologies/xcode.html
# brew
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
brew doctor
# UNIX stuff
brew install git
brew install imagemagick