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
| ffmpeg -i input.mp4 -filter:v "crop=674:64:0:0" output.mp4 |
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
| #!/usr/bin/env bash | |
| # | |
| # Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+ | |
| # This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open. | |
| # TODO Add option to close iTerm2 after cmd execs | |
| # See also https://www.iterm2.com/documentation-scripting.html | |
| # | |
| # Usage: |
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
| diff --git a/mac/mac_vanilla.py b/mac/mac_vanilla.py | |
| index 1565db7..28d5970 100644 | |
| --- a/mac/mac_vanilla.py | |
| +++ b/mac/mac_vanilla.py | |
| @@ -1,3 +1,5 @@ | |
| +from copy import deepcopy | |
| + | |
| import torch | |
| from torch import nn | |
| from torch import optim |
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
| class MultiHeadedMlp(nn.Module): | |
| def __init__(self, input_dim, *out_dims): | |
| super().__init__() | |
| self.out_dims = out_dims | |
| self.heads = nn.ModuleList([nn.Linear(input_dim, dim) for dim in out_dims]) | |
| def forward(self, i): | |
| return [h(i) for h in self.heads] | |
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
| #!/bin/bash | |
| echo "Restarting bluetooth service..." | |
| blueutil -p 0 && sleep 1 && blueutil -p 1 | |
| echo "Waiting bluetooth service to be restored..." | |
| until blueutil -p | grep "1" >/dev/null; do sleep 1; done | |
| echo "Searching for devices not connected..." | |
| devices=($(blueutil --paired | grep "not connected" | awk -F '[ ,]' '{print $2}')) |
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
| version: 0 | |
| hosts: | |
| fair: &devfair_host | |
| ip: localhost | |
| port: 41000 | |
| username: geyang | |
| pem: ~/.ssh/fair-loaner | |
| mounts: | |
| - !mounts.SSHCode &plan2vec_code | |
| <<: *devfair_host |
These code come from the Tensorflow documentation the (experimental) new Dataset API.
General types:
- one_shot
- initializable
- reinitializable
- feedable
Just changing the computer name in Sharing doesn't work. if you do ssh-keygen the older computer name still shows up.
In order to change the name of the computer, you need to do the following:
sudo scutil --set ComputerName "new-name"
sudo scutil --set LocalHostName "new-name"
sudo scutil --set HostName "new-name"