Skip to content

Instantly share code, notes, and snippets.

@ns-1m
ns-1m / gist:2296532
Created April 4, 2012 00:04
PHP Spatialite to GeoJSON
<?php
/**
* Spatialite to GeoJSON
It needs:
* apache2
* php5-cli
* php5-sqlite
@MikeRogers0
MikeRogers0 / weather-class.inc.php
Created June 16, 2012 17:04
Getting the Weather in PHP
<?php
class Weather {
 public $lat, $long, $weather, $location;
 private $weather_data, $location_data;

 public function __construct($lat=0.0, $long=0.0){
  $this->lat = (float) $lat;
  $this->long = (float) $long;
 }

@chrislkeller
chrislkeller / README.md
Last active December 18, 2020 08:12
SpreadSheet To Fusion Tables

Script to sync a Google SpreadSheet to a Fusion Table

Save for a few legacy projects that still use Fusion Tables I don't actively use this script anymore. This update hopefully solves the OAuth issue that cropped up once Google depcricated the Client Login method used by the prior version.

As always, your mileage may vary, and I welcome someone -- Google or otherwise -- to offer a long-term maintained solution.

The following is largely cribbed from a Google example here. I try to explain some of the API settings that must be enabled in the Developer's Console and elsewhere

Create your spr

@Tomalak
Tomalak / jquery-tablesorter-textextractor.js
Created July 6, 2012 17:11
A custom textExtraction function for jQuery tablesorter that allows better sorting for accented characters and dates in dd.mm.yyyy format. Primarily targeted at German text; might work well for other languages.
// Details: StackOverflow (http://stackoverflow.com/a/614397/18771)
// License: cc-by-sa (http://creativecommons.org/licenses/by-sa/3.0/)
// Extends: jQuery Tablesorter 2.0+ (http://tablesorter.com)
// -------------------------------------------------------------------
// file encoding must be UTF-8!
function getTextExtractor()
{
return (function() {
var patternLetters = /[öäüÖÄÜáàâéèêúùûóòôÁÀÂÉÈÊÚÙÛÓÒÔß]/g;
@iwek
iwek / grab-images-wikipedia.php
Created July 12, 2012 20:38
Retrieve Images from Wikipedia
<?php
/**
* Grab Images from Wikipedia via thier API
*
* @author http://techslides.com
* @link http://techslides.com/grab-wikipedia-pictures-by-api-with-php
*/
//curl request returns json output via json_decode php function
@RandomEtc
RandomEtc / convert.js
Created October 26, 2012 01:13
Simplify GeoJSON using d3-plugins/simplify (thanks @jasondavies for preserving topology!)
// TODO: options parser with overrides for projection, area etc.
if (process.argv.length != 4) {
console.error("usage: node convert.js <input.json> <output.json>");
process.exit(1);
}
require('d3')
require('./node_modules/d3-plugins/simplify/simplify.js')
var fs = require('fs');
@gurdiga
gurdiga / minify-js.sh
Created November 25, 2012 13:34
JS minifying script with curl and Closure Compiler REST API
#!/bin/sh
# Use like this:
#
# minify-js.sh < app.js > app.min.js
#
curl -s \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d output_format=text \
@jpatters
jpatters / HeidiDecode.js
Last active May 17, 2024 12:41
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@peterjaap
peterjaap / navicat_tunnel.php
Created March 13, 2013 12:28
Navicat tunnel file (the nearly unfindable ntunnel_mysql.php)
<?php //version my104
header("Content-Type: application/octet-stream");
error_reporting(0);
set_time_limit(0);
set_magic_quotes_runtime(0);
function phpversion_int()
{
list($maVer, $miVer, $edVer) = split("[/.-]", phpversion());
@yanofsky
yanofsky / LICENSE
Last active May 7, 2024 12:36
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit