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
// | |
// ContentView.swift | |
// StatusBarTest | |
// | |
// Created by hiroki on 2021/02/11. | |
// | |
import SwiftUI | |
struct ContentView: View { |
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 | |
# Script to install node.js 10.x and yarn repo onto a Debian or Ubuntu system (docker) | |
# | |
# Run as root or insert `sudo -E` before `bash`: | |
# | |
# Example: curl -sL https://gist.githubusercontent.com/alfmatos/f0a5218c80e4866da1beb90cffb008f9/raw/ | bash - | |
# Install nodejs 10.x | |
curl -sL https://deb.nodesource.com/setup_10.x | bash - |
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 String { | |
/* | |
Truncates the string to the specified length number of characters and appends an optional trailing string if longer. | |
- Parameter length: Desired maximum lengths of a string | |
- Parameter trailing: A 'String' that will be appended after the truncation. | |
- Returns: 'String' object. | |
*/ | |
func trunc(length: Int, trailing: String = "…") -> String { | |
return (self.count > length) ? self.prefix(length) + trailing : self |
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 | |
# Stop all containers. | |
docker stop $(docker ps -a -q) | |
# Delete all containers. | |
docker rm $(docker ps -a -q) | |
# Delete all images. | |
docker rmi --force $(docker images -q) |
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
<script type="text/javascript"> | |
function checkForm(){ | |
var forms = document.getElementsByTagName('form'); | |
for (var i = 0; i < forms.length; i++) { | |
forms[i].noValidate = true; | |
forms[i].addEventListener('submit', function(event) { | |
//Prevent submission if checkValidity on the form returns false. | |
if (!event.target.checkValidity()) { | |
event.preventDefault(); |
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
::States = { AK: "Alaska", | |
AL: "Alabama", | |
AR: "Arkansas", | |
AS: "American Samoa", | |
AZ: "Arizona", | |
CA: "California", | |
CO: "Colorado", | |
CT: "Connecticut", | |
DC: "District of Columbia", | |
DE: "Delaware", |
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
states = Array[ ["AK", "Alaska"], | |
["AL", "Alabama"], | |
["AR", "Arkansas"], | |
["AS", "American Samoa"], | |
["AZ", "Arizona"], | |
["CA", "California"], | |
["CO", "Colorado"], | |
["CT", "Connecticut"], | |
["DC", "District of Columbia"], | |
["DE", "Delaware"], |