Skip to content

Instantly share code, notes, and snippets.

@vuk-nikolic
vuk-nikolic / drive.py
Created June 11, 2018 09:40 — forked from basuke/drive.py
Create the GPX file from origin and destination using the GoogleMap Direction API. You can use this output for simulate the location apps in Xcode.
#
# python drive.py "origin" ["waypoint" ... ] "destination"
#
# i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO
import sys, json, urllib2, md5, os.path, pprint
from math import radians, sin, cos, atan2, pow, sqrt
from urllib import quote_plus
from xml.sax.saxutils import escape
from optparse import OptionParser
@vuk-nikolic
vuk-nikolic / ssid-finder.m
Created May 7, 2012 08:46
How to get current SSID (iOS)
#import <SystemConfiguration/CaptiveNetwork.h>
NSString *currentSSID = @"";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil){
NSDictionary* myDict = (NSDictionary *) CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict!=nil){
currentSSID=[myDict valueForKey:@"SSID"];
} else {
currentSSID=@"<<NONE>>";
@vuk-nikolic
vuk-nikolic / JsonActionInterceptor.java
Created February 1, 2012 10:00
JsonActionInterceptor
package com.klopaj.interceptor;
import com.klopaj.interceptor.meta.JsonAction;
import com.klopaj.interceptor.meta.JsonIn;
import flexjson.JSONDeserializer;
import flexjson.JSONSerializer;
import jodd.bean.BeanUtil;
import jodd.madvoc.ActionRequest;
import jodd.madvoc.interceptor.ActionInterceptor;
import jodd.servlet.ServletUtil;