Skip to content

Instantly share code, notes, and snippets.

ascendbruce /
Last active August 5, 2018 07:44 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Install dependency

Get Homebrew installed on your mac if you don't already have it.

brew install highlight

Highlight your source

ascendbruce /
Last active August 13, 2020 19:16
error when rake db:migrate with postgresql 9.6 and postgis 2.4. error message Server is version 9.6, library is version 10.0

error message

PG::InternalError: ERROR:  incompatible library "/usr/local/lib/postgresql/": version mismatch
DETAIL:  Server is version 9.6, library is version 10.0.
/Users/bruce/Projects/HB-Backend/db/migrate/20151013213623_enable_postgis.rb:3:in `change'
-e:1:in `<main>'

Caused by:
ascendbruce /
Created March 6, 2018 08:40
Find filenames contain illegal windows characters on Mac/Linux -- regex pattern match windows reserved characters
# Source:
# reserved characters for filename on windows:
find . -name '*[<>:/\\|?*]*'
ascendbruce /
Last active July 18, 2024 15:56
Use macOS-style shortcuts in Windows

Use macOS-style shortcuts in Windows / keyboard mappings using a Mac keyboard on Windows

ℹ️ There is a newer alternative project that does similar things and more, check it out at

Make Windows PC's shortcut act like macOS (Mac OS X) (using AutoHotkey (ahk) script)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

How does it work

ascendbruce / trello-cards-count-bookmarklet.js
Last active February 27, 2016 06:34
Show cards count bookmarklet for Trello
javascript: ! function() {
$(".js-num-cards").each(function(i) {
var size = $(".js-list:nth(" + i + ") .list-card-details").length;
$(".js-num-cards:nth(" + i + ")").text(size + " cards");
if ($(".board-header-btn-name .js-list-card-count").length === 0) {
$(".board-header-btn-name span").append(" <span class=\"js-list-card-count\"></span>");
ascendbruce / gist:ed51360753edf7ce1fd8
Last active February 6, 2016 10:57
Fetch facebook graph object scrape information clear cache in command line
curl -X POST -F "id={the url}" -F "scrape=true" ""
# from
# Available cops (199) + config for /Users/bruce/Projects/rails:
# Type 'Lint' (36):
Description: Checks for ambiguous operators in the first argument of a method invocation
without parentheses.
Enabled: false
Description: Checks for ambiguous regexp literals in the first argument of a method
ascendbruce / .pryrc
Last active August 29, 2015 14:10
rails console customization without modifying Gemfiles
# encoding: utf-8
# work-around from
required_version_gems = %w(
required_version_gems.each do |version_gem|
require 'benchmark'
require "active_support/core_ext/object/blank"
TIMES = 1000000
Benchmark.bmbm do |x|"if present? (actually present)") do
TIMES.times do
if "1".present?
# source:
#first load all models
#okay…each now :)
ActiveRecord::Base.send(:subclasses).each do |model|