Skip to content

Instantly share code, notes, and snippets.

@ildaroit
ildaroit / citystategeo.js
Created October 23, 2015 13:16 — forked from danasilver/citystategeo.js
Get only city and state from Google Maps API Reverse Geocoder
if (window.navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
var lat = position.coords.latitude,
lng = position.coords.longitude,
latlng = new google.maps.LatLng(lat, lng),
geocoder = new google.maps.Geocoder();
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
for (var i = 0; i < results.length; i++) {
@ildaroit
ildaroit / california_nad83_zones_min.geojson
Created October 26, 2015 15:02 — forked from zross/california_nad83_zones_min.geojson
Using geojson with Google Maps API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ildaroit
ildaroit / ab_test.sh
Created July 3, 2016 01:39 — forked from omerucel/ab_test.sh
Phalcon vs Slim, very basic test
ab -n 1000 -c 10 http://localhost/slim.php > slim.log
ab -n 1000 -c 10 http://localhost/phalcon.php > phalcon.log
@ildaroit
ildaroit / phalconphp_php7_ubuntu_16_04.sh
Created August 16, 2016 12:05 — forked from Tosyn/phalconphp_php7_ubuntu_16_04.sh
PhalconPhp with PHP7 Installation on Ubuntu 16.04
#!/bin/bash
# PhalconPhp with PHP7 installation on ubuntu:16.04
sudo apt-get update
sudo apt-get install -y php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \
@ildaroit
ildaroit / .htaccess
Created October 24, 2016 06:21 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@ildaroit
ildaroit / ToastNotification_Windows10.ps1
Created October 10, 2017 10:00 — forked from altrive/ToastNotification_Windows10.ps1
Windows 10 toast notification sample
$ErrorActionPreference = "Stop"
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString()
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
@ildaroit
ildaroit / rss-parser-script.php
Created November 17, 2017 20:56 — forked from finalwebsites/rss-parser-script.php
RSS parser script
<?php
$cache_time = 3600*24; // 24 hours
$cache_file = $_SERVER['DOCUMENT_ROOT'].'/cache/test.rss';
$timedif = @(time() - filemtime($cache_file));
if (file_exists($cache_file) && $timedif < $cache_time) {
$string = file_get_contents($cache_file);
} else {
$string = file_get_contents('http://www.web-development-blog.com/feed/');
@ildaroit
ildaroit / countries.sql
Created December 1, 2017 22:13 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@ildaroit
ildaroit / insert-posts.php
Created December 15, 2017 21:49
Insert a post into WordPress from an external script
<?php
// Load WordPress
require_once 'path/to/www/wp-load.php';
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
// Set the timezone so times are calculated correctly
date_default_timezone_set('Europe/London');
// Create post
<?php
/**************************** простые гет запросы **********************/
/***********
отправить простой get запрос
************/
function get_curl_go($url){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);