Skip to content

Instantly share code, notes, and snippets.

View florianthiery's full-sized avatar

Florian Thiery florianthiery

View GitHub Profile
@nevrome
nevrome / world_map_ascii.R
Last active August 8, 2022 13:45
R script to plot an ASCII world map with highlighted positions
# . . ... ........... . ...
#. ................. . .. ..... ...... ..... .......................
# . .......... ... ... .......................... .
# ............. . ...............................
# ............ .. X .. X.... .................
# ....... ..... .. ...................
# .. . ............ .... ..........
# . ............. . .. .
# ..... .......... .. .
# .......... ...... . ..
@nkentaro
nkentaro / urlcodec.py
Created January 16, 2017 10:27
url encode and decode in python3
import urllib.parse
def urlencode(str):
return urllib.parse.quote(str)
def urldecode(str):
return urllib.parse.unquote(str)
str = '{"name": "Kinkin"}'
@cmatskas
cmatskas / csvUploadTest.js
Last active January 11, 2023 19:42
csvUploadTest.js
<!DOCTYPE html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/0.71/jquery.csv-0.71.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// The event listener for the file upload
document.getElementById('txtFileUpload').addEventListener('change', upload, false);
@apneadiving
apneadiving / 00-setup.sql
Created October 16, 2015 07:20 — forked from michaeldelorenzo/00-setup.sql
Tree structure query with PostgreSQL
-- Create tables
CREATE TABLE groups (id serial NOT NULL, name character varying NOT NULL);
CREATE TABLE network_group_members (pid integer, cid integer NOT NULL);
-- Insert the groups
INSERT INTO groups (name) VALUES ('GROUP 1'),('GROUP 2'),('GROUP 3'),('GROUP 4'),('GROUP 5'),('GROUP 6'),('GROUP 7'),('GROUP 8'),('GROUP 9'),('GROUP 10'),('GROUP 11'),('GROUP 12'),('GROUP 13');
-- Build the "Network"
INSERT INTO network_group_members(pid,cid) VALUES (1,2),(1,3),(1,4),(2,5),(5,6),(5,7),(7,8),(3,9),(4,10),(4,11),(11,12),(12,13);
@mariozig
mariozig / migrate_repo.sh
Last active December 22, 2022 08:32
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@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