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
# Show running containers | |
docker container ls | |
# Show all containers | |
docker container ls -a | |
# Create container from image | |
# -d run as daemon in background | |
# -p say what port to map in container | |
# --name give container a name |
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
<string-array name="months_array"> | |
<item>January</item> | |
<item>February</item> | |
<item>March</item> | |
<item>April</item> | |
<item>May</item> | |
<item>June</item> | |
<item>July</item> | |
<item>August</item> | |
<item>September</item> |
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
ssnEditText.addTextChangedListener(new TextWatcher() { | |
@Override | |
public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
} | |
@Override | |
public void onTextChanged(CharSequence s, int start, int before, int count) { | |
// if user is typing string one character at a time | |
if (count == 1) { |
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
func testTextFieldLimit() { | |
// Set up view before interacting with the text field | |
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle(forClass: self.dynamicType)) | |
let vc = storyboard.instantiateViewControllerWithIdentifier("ViewController") as! ViewController | |
vc.loadView() | |
// Test maximum number of allowable characters | |
let atTheLimitString = String(count: maxNumCharacters, repeatedValue: Character("a")) | |
let atTheLimitResult = vc.textField(vc.textField, shouldChangeCharactersInRange: NSRange(location: 0, length: 0), replacementString: atTheLimitString) | |
XCTAssertTrue(atTheLimitResult, "The text field should allow \(maxNumCharacters) characters") |
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
public class FocusChangeEditText extends android.support.v7.widget.AppCompatEditText { | |
public FocusChangeEditText(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
OnFocusChangeListener dismissKeyboardOnTapListener = new OnFocusChangeListener() { | |
@Override | |
public void onFocusChange(View v, boolean hasFocus) { | |
if (!hasFocus) { | |
Keyboard.hide(v); | |
} | |
} |
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 BaseURL { | |
class func getFromEnvironment() -> String { | |
#if DEBUG | |
return "http://192.168.1.126" | |
#else | |
return "https://judgecardx.com" | |
#endif | |
} |
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
extension UIView { | |
var differentSuperviewsWarningMessage: String { | |
return "Since you are adding a constraint to self.superview, self and the view passed in need to have the same superview. The views you are trying to align do not have the same superview." | |
} | |
func centerInSuperview() { | |
self.centerVerticallyInSuperview() | |
self.centerHorizontallyInSuperview() | |
} | |
NewerOlder