- Setup
- Swapfile
- NGINX
- ElasticSearch
- RVM
- Rails
- Postgres
- Capistrano
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
private let linkDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue) | |
struct LinkColoredText: View { | |
enum Component { | |
case text(String) | |
case link(String, URL) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BC.registerElement "bc-require", | |
createdCallback: -> | |
@setAttribute("pending", "") | |
attachedCallback: -> | |
BC.ready => | |
if Loader.find(@script)?.loaded | |
@activate() | |
else | |
@deactivate() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener "trix-initialize", (event) -> | |
new TrixAutoLinker event.target | |
class TrixAutoLinker | |
constructor: (@element) -> | |
{@editor} = @element | |
@element.addEventListener("trix-render", @autoLink) | |
@autoLink() | |
autoLink: => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first install blueutil, 'brew install blueutil' | |
# next create a new Keyboard Maestro macro | |
# add a Execute Shell Action action to script and paste in the following: | |
bluetooth=$(/usr/local/bin/blueutil) | |
is_on="Power: 1" | |
if [[ "$bluetooth" =~ "$is_on" ]]; | |
then | |
/usr/local/bin/blueutil power 0 | |
else |
#Scoped Invitation System for User Groups with Rails#
Starting out with the following models and associations:
####User
- has_many :memberships
- has_many :organizations through :memberships
####Organization (User Group)
- has_many :memberships