Skip to content

Instantly share code, notes, and snippets.

! (C) 2013 Charles Alston.
USING: accessors arrays byte-arrays fry google.search io
io.encodings.utf8 io.launcher kernel locals make namespaces
sequences splitting strings unicode.categories vectors ;
FROM: webbrowser => open-file open-url ;
IN: spotlight
! *** searching on os x via spotlight metadata index, & managing indexing from factor ***
! *** mac os x 10.6.8 & later: implementing mdfind, mdls, mdutil, mdimport ***
! mdfind, mdls, mdutil, mdimport take a query on the stack
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@jonlabelle
jonlabelle / television_resolution_standards.md
Last active October 25, 2025 18:18
Digital and analog television standards resolution reference.

Television Standards

Digital and analog television standards resolution reference.

Digital TV Standards

Standard Resolution (dots × lines) DAR (H:V) Pixels
PixelVision 120 × 90 4:3 10,800
@gg7
gg7 / chromium-bookmark-folders.patch
Last active April 4, 2025 14:33
Increase the number of recently shown folders (5) in chromium when adding/modifying a bookmark
diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
index 88df062..5adbc2e 100644
--- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
+++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
@@ -14,7 +14,7 @@
namespace {
// Max number of most recently used folders.
-const size_t kMaxMRUFolders = 5;
+const size_t kMaxMRUFolders = 20;
@t-io
t-io / osx_install.sh
Last active April 27, 2025 20:06
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@n8henrie
n8henrie / txt_to_reminders.applescript
Last active September 29, 2025 00:01
Demonstration of using AppleScript with Reminders.app
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder
--set theLines to paragraphs of theFileContents
set theLines to {"task name 1", "task name 2"}
repeat with eachLine in theLines
tell application "Reminders"
set mylist to list "Your List Name"
tell mylist
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"}
@iharosi
iharosi / useful-osx-commands.md
Last active September 21, 2023 07:25
Useful OS X commands

###Useful OS X commands

  1. App Store Debug menu

    Show

    defaults write com.apple.appstore ShowDebugMenu -bool true
    

    Hide

@trusktr
trusktr / DefaultKeyBinding.dict
Last active October 18, 2025 09:55
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@torque
torque / instructions.md
Last active December 6, 2020 01:32
mpv url-overlay example.

Instructions

  1. clone this gist: git clone https://gist.github.com/5af90be72b98bce36a3e.git mpv-url-overlay-example
  2. copy (or symlink) url-overlay.lua to your mpv scripts directory (~/.config/mpv/scripts or ~/.mpv/scripts)
  3. mpv --no-osc url-overlay-example.mkv
  4. Hold tab to highlight all on-screen urls. If you already use tab for something, bind some key to the command mp_url_overlay_show.
  5. Click urls to launch them. On Linux xdg-open is required. Will not work if you have MOUSE_BTN0 bound to another command.
@githubutilities
githubutilities / Uninstall-pkg.md
Last active October 10, 2025 20:22
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info