This file contains 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/zsh | |
startPath=`pwd` | |
setupTmpdir() { | |
relTmpDir=`mktemp -d /tmp/lazygitRepoPath.XXXXXX` | |
TMPDIR=`realpath "$relTmpDir"` | |
cd $TMPDIR | |
} |
This file contains 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
// This is a "rough sketch" pulled from our application that shows how we use | |
// RxBluetoothKit and Nordic's DFU library together. It's more than | |
// pseudocode, yet not standalone, rigorously tested running code. A lot of | |
// details are simplified or omitted here, e.g. any device-specific details | |
// you may require, implementations for Nordic's DFU delegate protcols, etc. | |
import iOSDFULibrary // Nordic's DFU Library | |
import RxBluetoothKit | |
enum ExampleDeviceService: String, ServiceIdentifier { |
At the time of writing this gist (January 4th, 2017), I was unable to find true sandboxing to separate development and production environments for a Firebase project. The closest we can get is to create two separate Firebase projects -- one for development and one for production.
- Complete separation and isolation of all Firebase features.
- Freedom to experiment without risking the corruption of production data.
- There is no way to copy production data to your development project (that I am aware of).
- Any settings changes made to your development project also needs to be manually applied to your production project.
This file contains 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 Foundation | |
extension ArraySlice { | |
// Overwrites the ArraySlice region with the passed-in array of bytes | |
mutating func setBytes(_ from: [UInt8]) { | |
var fromIter = from.makeIterator() | |
self.withUnsafeMutableBytes { bytes in | |
for i in stride(from: bytes.startIndex, to: bytes.endIndex - 1, by: 1) { | |
if let fromByte = fromIter.next() { | |
bytes[i] = fromByte |
This file contains 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/sh | |
git -c color.status=always status -s | sed "1s/^/$*\\ | |
/" |
This file contains 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
Host vagrant | |
User vagrant | |
HostName 127.0.0.1 | |
Port 2222 | |
Compression yes | |
PubkeyAuthentication yes | |
LogLevel FATAL | |
StrictHostKeyChecking no | |
UserKnownHostsFile /dev/null | |
IdentitiesOnly yes |
This file contains 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
set deviceID to (do shell script "diskutil list | awk '/YourBootcampPartition/ {print $NF}'") | |
do shell script "sudo bless -device /dev/" & deviceID & " -legacy -setBoot -nextonly" | |
tell application "Finder" to restart |
This file contains 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 zsh | |
# This is a utility wrapper around git update-index used to mark, unmark, and | |
# list files that are marked with the assume-unchanged bit. See `git help | |
# update-index` for details. | |
# | |
# Usage: | |
# git embargo <FILE> # Mark a file as embargoed -- changes won't appear in status | |
# git embargo -r <FILE> # Remove the embargo | |
# git embargo -l|--list # List all embargoed files |
This file contains 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
include_recipe "git" | |
%w{ vim zsh }.each { |p| package p } | |
bash "Set vagrant's shell to zsh" do | |
code <<-EOT | |
chsh -s /bin/zsh vagrant | |
EOT | |
not_if 'test "/bin/zsh" = "$(grep vagrant /etc/passwd | cut -d: -f7)"' | |
end |
NewerOlder