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
extension UIView { | |
func reveal() { | |
if self.alpha == 1.0 { | |
return | |
} | |
UIView.animate(withDuration: 0.5) { | |
self.alpha = 1.0 | |
self.isUserInteractionEnabled = true | |
} | |
} |
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 Foundation | |
extension String { | |
// Example usage: "My Text".localized() | |
func localized() -> String { | |
return Bundle.main.localizedString(forKey: self, | |
value: nil, | |
table: nil) | |
} |
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 | |
# To make this file executable from the command line, enter: `chmod +x reload.sh` | |
aai app exec sudo killall python -9 --no-container | |
aai app deploy --yes | |
aai app start |
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 | |
# To make this file executable from the command line, enter: `chmod +x hot-reload.sh` | |
nodemon -x "./reload.sh" --ext py |
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 | |
# In ubuntu / ubuntu VM | |
sudo apt-get update && sudo apt-get upgrade -y | |
sudo apt-get update && sudo apt-get install nodejs -y | |
sudo apt-get install npm -y | |
sudo apt-get remove docker docker-engine docker.io -y | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
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 | |
############ | |
# Simple script for preparing and deploying an alwaysAI app to Balena | |
# app_name arg should match the name of the application created in Balena | |
# To make this script runnable: run `chmod +x _name_of_this_script_.sh` in your command line | |
# NOTE: The entire app should exist in it's own repo. | |
############ | |
# Extract app name from arg if present |
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 | |
# If this file is in your project root dir `aai app deploy` | |
# will copy this to the target device app root directory. | |
# Then either run this on the target deployment device | |
# with ./build_standalone.sh by direct ssh or by using | |
# `aai app shell --no-container` from your dev machine. | |
# Additional information at https://dashboard.alwaysai.co/docs/application_development/packaging_app_as_docker_image.html | |
echo 'Image name for standalone file? (no spaces)' | |
read image_name |
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 'Name of connection to make static (select from "nmcli conn show"):' | |
read CONN_NAME | |
echo $CONN_NAME | |
echo | |
echo 'IP Address to assign:' | |
read IP_ADDRESS | |
echo IP_ADDRESS |
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 React from "react"; | |
import "./styles.css"; | |
export default function App() { | |
return ( | |
<div className="App"> | |
<h1>Hello CodeSandbox</h1> | |
<h2>Start editing to see some magic happen!</h2> | |
</div> | |
); |
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 React from "react"; | |
import ReactDOM from "react-dom"; | |
import App from "./App"; | |
const rootElement = document.getElementById("root"); | |
ReactDOM.render( | |
<React.StrictMode> | |
<App /> | |
</React.StrictMode>, |