Skip to content

Instantly share code, notes, and snippets.

View sudara's full-sized avatar
🧪
Brewing new formulas

Sudara sudara

🧪
Brewing new formulas
View GitHub Profile
@mazbox
mazbox / xcode-music-pause.sh
Last active January 13, 2023 01:25
play/pause Music.app on Mac when running
#!/bin/zsh
musicAppOpen=`osascript -e 'tell application "System Events" to (name of processes) contains "Music"'`
rm -f "/tmp/xcode-itunes.txt"
if [ $musicAppOpen = 'true' ]; then
musicState=`osascript -e 'tell application "Music" to player state as string'`
if [ $musicState = 'playing' ]; then
echo 'play' > '/tmp/xcode-itunes.txt'
osascript -e 'tell application "Music" to pause'
@aks
aks / README-migration-apis.md
Created February 23, 2018 21:54
ActiveRecord Migration actions (methods)

ActiveRecord::Migration API Notes

The ActiveRecord::Migration class is used to manage Rails migration scripts. When writing these scripts, there are many class methods that can be used to make schema changes, which are described below in several sections.

Migration Methods

Create Methods Arguments Notes Rev
create_join_table table1, table2, options Creates a join table Y
create_table name, options Creates a table Y
@qrush
qrush / gist:4676363
Created January 30, 2013 20:04
top 1000 gems by downloads
[[25433345, "thor"],
[23854425, "rake"],
[21253644, "rails"],
[21575987, "rack"],
[19408780, "activesupport"],
[16265610, "activerecord"],
[15920580, "actionpack"],
[16207231, "json"],
[15497117, "actionmailer"],
[15335833, "activeresource"],
@roidrage
roidrage / ebooks.md
Created December 2, 2011 15:15
Self-published and awesome