Skip to content

Instantly share code, notes, and snippets.

@hkrishna
hkrishna / gist:d0a3ffab8160f1ddef0d
Last active August 29, 2015 14:08
Set up Pelias (Quick and Dirty)

mkdir pelias

Schema

git clone git@github.com:pelias/schema.git
npm install

install plugin

(if you used homebrew to install elasticsearch it should be /usr/local/Cellar/elasticsearch)

@rmarianski
rmarianski / anonstruct.c
Created December 29, 2014 15:41
Embed structures in c
#include <stdio.h>
typedef struct point {
int x, y;
} point;
typedef struct point3d {
struct point;
int z;
} point3d;
@aaronlidman
aaronlidman / gist:2691527
Created May 14, 2012 02:55
ogr2ogr 900913
ogr2ogr [output] [input] -skipfailures -t_srs EPSG:900913 -clipsrc -180 -85.0511 180 85.0511
@missinglink
missinglink / build.sh
Last active December 11, 2016 04:24
Pelias Build Script
#!/bin/bash
# Dependencies
for dep in 'git' 'wget' 'curl'; do
if [ ! `which $dep` ]; then
echo "$dep required, please install it and try again";
exit 1;
fi
done
@sevko
sevko / README.md
Last active November 6, 2019 17:28
Import Quattroshapes into PostgreSQL.

import quattroshapes into PostgreSQL

The import_quattroshapes_pgsql.sh shell-script will import all Quattroshapes shapefiles into a PostgreSQL database. The process has some gotchas and is generally painful to do manually. Before running the script, ensure that you are logged in as a user with permissions to access/write to PostgreSQL. Then:

bash import_quattroshapes_pgsql.sh

Note that the script will create a Postgres table quattroshapes, and download all Quattroshapes shapefiles into

@zearen
zearen / JSONParser.hs
Created January 28, 2012 04:00
A simple haskell demonstation showing parsing JSON with Parsec
{-
Zachary Weaver <zaw6@pitt.edu>
JSONParser.hs
Version 0.1.1
A simple example of parsing JSON with Parsec in haskell. Note that
since the primary point of this excersize is demonstration,
Text.Parsec.Token was avoided to expose more of the grammar. Also,
complicated optimizations and shorcuts were avoided (mostly).
@avalonalex
avalonalex / RSA.py
Last active March 6, 2021 10:46
A implementation of RSA public key encryption algorithms in python, this implementation is for educational purpose, and is not intended for real world use. Hope any one want to do computation like (a^b mode n) effectively find it useful.
#!/usr/bin/env python
import argparse
import copy
import math
import pickle
import random
from itertools import combinations
@missinglink
missinglink / go-ubuntu-install.md
Last active October 21, 2021 17:39
Install go on ubuntu

note: always check for the latest versions, the version numbers shown here will fall out of date quickly.

Installing Go on Ubuntu:

Step 1. Grab yourself a binary release from here: https://golang.org/dl/

You'll want to use one from the Stable versions, you probably want one which is in bold, for Ubuntu it's xxx-linux-amd64.tar.gz

wget https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz;
import ctypes
from ctypes import pythonapi as api
import sys
from types import (BuiltinFunctionType, GetSetDescriptorType, FrameType,
MemberDescriptorType, MethodType)
import guppy
from guppy.heapy import Path
hp = guppy.hpy()
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev