Skip to content

Instantly share code, notes, and snippets.

View ponciusz's full-sized avatar

Kamil Albrycht ponciusz

View GitHub Profile
@ponciusz
ponciusz / capture.js
Created January 8, 2017 18:54 — forked from gaspanik/capture.js
Take screenshot at single viewport size using CasperJS
var screenshotUrl = 'http://example.com/'
var casper = require("casper").create({
viewportSize: {
width: 1024,
height: 768
}
});
if (casper.cli.args.length < 1) {
@ponciusz
ponciusz / gist:ac6f36b6cd886c46c155
Created December 22, 2015 23:08 — forked from clnmcgrw/gist:9086505
Google Maps API Geocode Example - PHP/JSON
<?php
// address to map
$map_address = "";
$url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=".urlencode($map_address);
$lat_long = get_object_vars(json_decode(file_get_contents($url)));
// pick out what we need (lat,lng)
$lat_long = $lat_long['results'][0]->geometry->location->lat . "," . $lat_long['results'][0]->geometry->location->lng;