Skip to content

Instantly share code, notes, and snippets.

Severyn Kozak sevko

Block or report user

Report or block sevko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sevko
sevko / README.md
Last active Nov 6, 2019
Import Quattroshapes into PostgreSQL.
View README.md

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

@sevko
sevko / README.md
Last active Oct 6, 2019
Compile a full-featured Vim (w/ Python, Ruby, etc.).
View README.md

compile full Vim

The default Vim installed on most Linux distros lacks a number of vital features, like xterm_clipboard (allows copy-and-pasting to the system clipboard) and python (on which certain plugins rely). The compile_full_vim.sh shell script removes the currently installed Vim and compiles a full-featured version; it's based entirely off Valloric's YouCompleteMe walkthrough, which it bundles into a simple script for convenience. Vim will be compiled with the following feature flags:

  • --with-features=huge
  • --enable-multibyte
@sevko
sevko / README.md
Last active Oct 10, 2018
Parallel versions of pylint for Python 2 and 3.
View README.md

pylint+

Developers commonly work on both Python 2 and 3 codebases, so it's desirable to configure the pylint utility to execute against a specific version of the language. Problematically, it relies on the system-wide Python interpreter (for abstract syntax trees, etc.), so simply passing in a flag, like --use-version 3, wouldn't suffice; the solution is to write a thin wrapper script around pylint which executes it with the proper interpreter.

requirements

You must have:

  • python2 in your $PATH
@sevko
sevko / README.md
Last active Aug 29, 2015
Parallel versions of bpython for Python 2 and 3.
View README.md

bpython+

bpython+ is a thin wrapper around the bpython interpreter, which allows the user to specify whether it should be executed with version 2 or 3 of the Python interpreter; the implementation is practically identical to that of pylint+.

requirements

You must have:

  • python2 in your $PATH
  • python3 in your $PATH
@sevko
sevko / README.md
Last active Aug 29, 2015
How to add a map to any webpage without Google Maps.
View README.md

adding a map to any website

Rendering a web-map without resorting to Google Maps is surprisingly trivial. The following example uses the incredible open-source Leaflet library and map tiles provided by OpenStreetMap. Check it out on rawgit.

@sevko
sevko / microtime.c
Created Mar 21, 2015
Get the current time in microseconds in C.
View microtime.c
#include <sys/time.h>
/**
* Returns the current time in microseconds.
*/
long getMicrotime(){
struct timeval currentTime;
gettimeofday(&currentTime, NULL);
return currentTime.tv_sec * (int)1e6 + currentTime.tv_usec;
}
@sevko
sevko / README.md
Created Sep 3, 2015
simple Python raytracer
View README.md

raytracer

A simple Python raytracer that supports spheres with configurable "material" properties (base color and a bunch of light coefficients). To generate a raytraced image of the pre-defined scene, run: python raytracer.py and open image.ppm with a PPM-compatible viewer (eog works fine on Linux):

raytraced spheres

acknowledgements

I found the following resources extremely helpful:

You can’t perform that action at this time.