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
class UITextViewWithPlaceholder: UITextView, UITextViewDelegate { | |
private var placeholderLabel: UILabel?; | |
required init?(coder: NSCoder){ | |
super.init(coder: coder) | |
self.delegate = self; | |
} | |
func setPlaceholder(text: String, color: UIColor = Constants.View.whiteColor.withAlphaComponent(0.5)) { | |
if (self.placeholderLabel == 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
import javax.tools.*; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.lang.reflect.Method; | |
import java.net.URI; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Iterator; |
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
// Demo: http://jsfiddle.net/xuyp8qb5/ | |
// Note: You need Google Map API Key to run demo; bit.ly/2pBgToW | |
var latlng; | |
latlng = new google.maps.LatLng(40.730885, -73.997383); // New York, US | |
//latlng = new google.maps.LatLng(37.990849233935194, 23.738339349999933); // Athens, GR | |
//latlng = new google.maps.LatLng(48.8567, 2.3508); // Paris, FR | |
//latlng = new google.maps.LatLng(47.98247572667902, -102.49018710000001); // New Town, US | |
//latlng = new google.maps.LatLng(35.44448406385493, 50.99001635390618); // Parand, Tehran, IR | |
//latlng = new google.maps.LatLng(34.66431108560504, 50.89113940078118); // Saveh, Markazi, IR |
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
String.implement({ | |
attempt: function() { | |
var parts = this.split('.'), len = parts.length; | |
var func = window, bind; | |
for (var i=0; i<len; i++) { | |
if (func.hasOwnProperty(parts[i])) { | |
bind = func; | |
func = func[parts[i]]; | |
} | |
} |