Skip to content

Instantly share code, notes, and snippets.

@Aplusplus
Aplusplus / related-products.liquid
Created February 10, 2016 00:21
Shopify related products for PDP
@Aplusplus
Aplusplus / whereami.sh
Created July 1, 2011 07:40 — forked from pachacamac/whereami.sh
Wanna know where you are?
#!/bin/bash
echo -n "{\"version\": \"1.1.0\",\"host\": \"maps.google.com\",\"request_address\": true,\"address_language\": \"en_GB\", \"wifi_towers\": [`iwlist scan 2> /dev/null | tr -d '\n' | sed -e 's/Cell [0-9]* - Address: \([0-9A-Z:]*\)[^C]*Channel:\([0-9]*\)[^S]*Signal level=\([0-9-]*\) dBm[^E]*E[^E]*ESSID:"\([^"]*\)"/\{"mac_address": "\1","signal_strength": \3,"age": 0,"channel": \2,"ssid": "\4"}/g' -e 's/[^{]*{/{/' -e 's/}[^{]*{/},{/g' -e 's/\}[^}]*$/\}/' `]}" | curl -s -X POST -d @/dev/fd/0 http://www.google.com/loc/json
# TIP: run with sudo for improved accuracy since iwlist can then provide more than the active hotspot
/**
* Google Maps Tile Carver for Photoshop
*
* @description Tiles a photoshop image to create a Custom Map Type for Google Maps API, tested with CS4 and CS5
* @since 2010-09-01
* @author Will James, http://onNYTurf.com (creator)
* @author Curtis Wyatt, http://gocalipso.com/
* @author Nate Bundy, http://www.lemonrage.com/
* @author Uli Schöberl, http://aplusplus.org
*/
function drawArc(centerX:Number, centerY:Number, startAngle:Number, endAngle:Number, radius:Number, direction:Number)
/*
centerX -- the center X coordinate of the circle the arc is located on
centerY -- the center Y coordinate of the circle the arc is located on
startAngle -- the starting angle to draw the arc from
endAngle -- the ending angle for the arc
radius -- the radius of the circle the arc is located on
direction -- toggle for going clockwise/counter-clockwise
*/
{