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
mkdir -p /usr/local/opt/mysql/8.0 | |
chmod -R ug+w /usr/local/opt/mysql/ | |
# Add /usr/local/opt to docker file sharing | |
docker run --restart always --name mysql8.0 -v /usr/local/opt/mysql/8.0:/var/lib/mysql -p 3306:3306 -d -e MYSQL_ROOT_PASSWORD=winteriscoming mysql:8.0 | |
alias mysql8="mysql --host 0.0.0.0 --port 3306 --password=winteriscoming -u root" |
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
docker run --restart always --name redis -p 6379:6379 -d redis | |
alias redis-cli="docker exec -it redis redis-cli" |
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
swift package --enable-pubgrub-resolver update |
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
struct ValidateErrors: ValidationError { | |
/// the errors thrown | |
var errors: [ValidationError] | |
/// See ValidationError.keyPath | |
var path: [String] | |
/// See ValidationError.reason | |
var reason: String { | |
return errors.map { error in |
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
root@applypixels:~# dokku --trace mysql:backup applypixels applypixels-db-backup >> trace-backup.log | |
+ export DOKKU_HOST_ROOT=/home/dokku | |
+ DOKKU_HOST_ROOT=/home/dokku | |
+ export DOKKU_DISTRO | |
++ . /etc/os-release | |
++ echo ubuntu | |
+ DOKKU_DISTRO=ubuntu | |
+ export DOKKU_IMAGE=gliderlabs/herokuish | |
+ DOKKU_IMAGE=gliderlabs/herokuish | |
+ export DOKKU_LIB_ROOT=/var/lib/dokku |
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
// Make sure to include font files in bundle | |
// Add "Fonts provided by application" / UIAppFonts to Info.plist (use filename) | |
// Run this snippet in AppDelegate to find the name of your fonts | |
UIFont.familyNames.forEach { family in | |
print(family) | |
UIFont.fontNames(forFamilyName: family).forEach { names in | |
print(" - ", names) | |
} | |
} |
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
class FairPlayer: AVPlayer { | |
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue") | |
func play(asset: AVURLAsset) { | |
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be | |
// triggered when FairPlay handling is required. | |
asset.resourceLoader.setDelegate(self, queue: queue) | |
// Load the asset in the player. |
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 React from 'react'; | |
const hasDataForKey = (staticContext) => (key) => staticContext && Object.keys(staticContext.data).includes(key); | |
const windowHasDataForKey = (window) => (key) => Object.keys(window.__DATA__).includes(key); | |
export default ({ key, prop, getData }) => (WrappedComponent) => { | |
class SSRCompatibleComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {}; |
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 React, { Component } from 'react'; | |
const hasDataForThisKey = (staticContext) => | |
(key) => staticContext && Object.keys(staticContext.data).includes(key); | |
const windowHasDataForThisKey = (window) => | |
(key) => Object.keys(window.__DATA__).includes(key); | |
export default ({ | |
key, |
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 | |
import UIKit | |
extension UIView { | |
func addSubviews(_ subviews: [UIView]) { | |
for view in subviews { | |
addSubview(view) | |
} | |
} | |
} |