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
var polys = document.querySelectorAll('polygon,polyline'); | |
[].forEach.call(polys,convertPolyToPath); | |
function convertPolyToPath(poly){ | |
var svgNS = poly.ownerSVGElement.namespaceURI; | |
var path = document.createElementNS(svgNS,'path'); | |
var points = poly.getAttribute('points').split(/\s+|,/); | |
var x0=points.shift(), y0=points.shift(); | |
var pathdata = 'M'+x0+','+y0+'L'+points.join(' '); | |
if (poly.tagName=='polygon') pathdata+='z'; |
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
$.fn.scrollTo = function(ele) { | |
$(this).animate({ | |
scrollTop: $(ele).position().top | |
}, 1000); | |
}; | |
$('.scrollto').click(function(e) { | |
e.preventDefault(); | |
var target = $(this).attr('href'); | |
var scrollpx = $(target).offset().top; |
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
function getPolylines(geometry, style) { | |
// Parse Geometry | |
var kmlstring = geometry.toString(); | |
kmlstring = kmlstring.substr(40); | |
kmlstring = kmlstring.substr(0, kmlstring.length - 43); | |
var linestrings = kmlstring.split("</coordinates></LineString><LineString><coordinates>"); |
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
var counter = setInterval(timer, 1); | |
var count = 0; | |
function timer() { | |
count++; | |
var ele = document.getElementById("thisdiv"); | |
if (ele.className.indexOf('ng-hide') !== -1) { | |
clearInterval(counter); | |
console.log(count, count / 1000); | |
setTimeout(function() { |
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
<?php | |
/** | |
* @return none | |
*/ | |
function prepareView() | |
{ | |
compressFiles([ | |
'css/src/normalize.css', | |
'css/src/styles.css', |
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
@IBOutlet weak var myTextField: UITextField! | |
// Dismisses keyboard by touching outside of keyboard | |
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | |
// Dismiss keyboard | |
self.view.endEditing(true) | |
} |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
NotificationCenter.default.addObserver(self, | |
selector: #selector(applicationDidEnterBackground), | |
name: NSNotification.Name.UIApplicationDidEnterBackground, | |
object: nil) | |
NotificationCenter.default.addObserver(self, |
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
<ul> | |
<?php global $query_string; | |
query_posts ( $query_string . '&posts_per_page=5&offset=0'); ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<li><a href="#post-<?php the_ID(); ?>" title="Read <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br /> | |
<span><?php the_time('n/j/y')?></span> - <span><?php the_author() ?></span> - <?php the_tags( '<span>', ', ', '</span>'); ?> | |
</li> | |
<?php endwhile; ?> | |
</ul> |
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
<?php if (is_page('web-design')) : ?> | |
<?php $i = 0; ?> | |
<div> | |
<ul> | |
<?php | |
$args = array( | |
'post_parent' => $post->ID, | |
'post_type' => 'page', | |
'post_status' => 'publish', | |
'orderby' => 'menu_order', |
OlderNewer