mac


Jun. 10, 2020

nvALT Revisit

I am looking for an app to do random text input on the macOS, and sync through my own and company’s laptops. I tried Tot/Drafts, since I removed my iCloud account on the company’s laptop, the only modern way is using Dropbox. Then I get back the nvALT after I found it supports backlink, but inside of the app itself, by using [[text]], you can click it to search the nvALT with text. Gruvbox Dark Color Based on Gruvbox color scheme Font: SF Compact Text Search Highlight: #FE8019 Foreground Text: #EBDBB2 Background: #282828 Website: jma.dev Weekly Tech bookmarks: funcmarks

May. 29, 2020

Which browser for what link on macOS

It’s hard to split work and personal usage on the laptop at all. I would like to open work related web pages on Google Chrome, and all others go to Safari Before I have a Keyboard Maestro Marcos, I manually copy the address to clipboard and use hotkey to open it in the Google Chrome. However, this needs two more steps that are right-clicking or selection, and the hotkey. Then I find a few apps that can do the same with just clicking. You need to set the app as the default browser, and once you click the address, the app will help you forward to the specific app by the rule you set up. I also made a shortcuts on iOS that you can use share sheet or clipboard to open the address in Google Chrome iOS. Choosy The only one supports Google Chrome Profile so far. So if you have multiple profiles in Google Chrome, this is the only choice for you right now. Also, it has a similar popup browser selection like Bumpr. Bumpr The UI is the best, especially the popup browser selection, however, once you set up the rule, you could not edit it. Browser Opener Similar to Choosy, but not support Google Chrome Profile yet Finicky Very recently found this open source, you need to write a config file using JavaScript rather than GUI. However, there is a page finicky kickstart that helps you generate a basic config file. Also, There is one feature that you can edit the urls before opening.

May. 28, 2020

Using Brewfile to automatic setup macOS from scratch

brew bundle https://github.com/Homebrew/homebrew-bundle The bundle is automatically installed once it is used. dump current apps to Brewfile brew bundle dump Import from Brewfile Run the cmd from the same folder of Brewfile brew bundle I would like to put it in my dotfiles. This one is mine

Aug. 23, 2019

Alacritty font smooth on Mac

cg_context.set_allows_font_smoothing(false); cg_context.set_should_smooth_fonts(false); cg_context.set_allows_font_subpixel_quantization(false); cg_context.set_should_subpixel_quantize_fonts(false); cg_context.set_allows_font_subpixel_positioning(false); cg_context.set_should_subpixel_position_fonts(false); Change the value from true to false in font/src/darwin/mod.rs, then build Alacritty The font is displaying much better on Mac OSX (at least for me) If you have not tried Alacritty + Tmux + vim(Neovim), you should do it. Here is a good article to talk about this set ‘Alacritty integration with Tmux’

Jan. 15, 2019

Setup GPG for git on macOS

Install gnupg and pinentry-mac brew install gnupg brew install pinentry-mac Generating a GPG key Generating key gpg --full-generate-key Checking my key gpg --list-secret-keys --keyid-format LONG Copying key gpg --armor --export 3AA5C34371567BD2 | pbcopy Setting key for git git config --global user.signingkey 3AA5C34371567BD2 Full help https://help.github.com/articles/generating-a-new-gpg-key/ Setting to load key nvim .gnupg/gpg-agent.conf pinentry-program /usr/local/bin/pinentry-mac Backup and restore gpg --export-secret-keys KEY_ID > my-private-key.asc gpg --import my-private-key.asc

Jul. 25, 2016

Homebrew Services Operation not permitted

You will get this kind of error message when you run brew services in tmux /usr/local/Cellar/something/homebrew.mxcl.something.plist: Operation not permitted How to fix it, just need install reattach-to-user-namespace brew install reattach-to-user-namespace

Jan. 15, 2015

Install Mcrypt on Mac by Homebrew

Recently I setup Laravel enviroment on my Macbook, when I create project or run php artisan, it always prompts Mcrypt PHP extension required. error for me. Becuase I am using vagrant homestead for Laravel development, I can homestead ssh to run commands, but I think it’s better and convenience for me to install Mcrypt on my local enviroment. Then I did some reseach, and setup Mcrypt with mac native PHP. There are three ways I found: Manually complie Mcrypt source and install Using Homebrew to install Using MAMP Mcrypt For my requirement, I think homebrew is the best way for me. First Install autoconf which is needed when homebrew compling Mcrypt brew install autoconf Homebrew tap Homebrew dupes, versions, and homebrew-php tap brew tap homebrew/dupes brew tap homebrew/versions brew tap homebrew/homebrew-php Install php55 or php56 brew install php55 or brew install php56 PHP Mcrypt brew install php55-mcrypt or brew install php56-mcrypt Last add mcrypt extension into /etc/php.ini. You can find path using brew info php55-mcrypt, eg. extension= /usr/local/Cellar/php55-mcrypt/5.5.20/mcrypt.so

Apr. 9, 2014

Keyboard Maestro as a replacement for TextExpander

Recently, I started to try Keyboard Maestro, and some people talked about it can be used as a replacement for TextExpander. Even I am not super fan of TextExpander, but I still use it sometimes. I decided to try it to see difference. Trigger Add a new trigger, select Typed String Trigger, then This string is typed. Type any short string as trigger, eg. I use gml (two spaces after gml). And other options which you can select as you like. Make sure you tick Simulaate x deletes before executing, otherwise the trigger phrase won’t be deleted before expansion is inserted. Actions There are only two actions. One is Insert Text, and another is Delete Past Clipboard Insert Text action, type the expansion into the textarea, and you also can use Insert Token to add variables of Keyboard Maestro given. Delete Past Clipboard action, change the value to 0(default is 1), because Insert Text action will paste the expansion to clipboard, and replace any previously copied.

Jun. 24, 2013

Hide Any File or Folder with Command

Mac only hide: chflags hidden /path/to/file-or-folder unhide: chflags nohidden /path/to/file-or-folder

Aug. 15, 2012

Running Pow And MAMP Pro Together

source: Running Pow with Apache I use both Pow for rails development and MAMP Pro for PHP development. I need them work simultaneously. Before start, if you have Pow installed, uninstall it with curl get.pow.cx/uninstall.sh | sh Then let pow’s firewall run to redirect all traffic from port 88 instead of port 80 echo 'export POW_DST_PORT=88' >> ~/.powconfig Then you can install Pow as normal curl get.pow.cx | sh Now, open MAMP Pro, create a new host. Doesn’t matter what it is named and which directory is selected (though I use ‘rails.dev’ and the folder I keep my Rails apps in).Also, deselect the select box for “local name resolution”, just in case. Then go to the Advanced tab, and fill this in to the textarea labeled “Customized virtual host general settings”: ServerName pow ServerAlias *.dev ProxyPass / http://localhost:20559/ ProxyPassReverse / http://localhost:20559/ ProxyPreserveHost On

Jun. 24, 2012

Terminal Prompt for Mac OS X

I have re-installed my Macbook Pro with Mac OS X Lion. And I did another research to enhance terminal prompt to make it get better looking. What I need: seperate each command part show git branch colors You can get it from here