Skip to content

Instantly share code, notes, and snippets.

View john-science's full-sized avatar

John Stilley john-science

View GitHub Profile
@john-science
john-science / proj4_2_wkt.py
Last active May 11, 2021 06:26
Converting Proj4 String to Well-Known Text
from osgeo.osr import SpatialReference
"""
A quick script to get the Well-Known Text from a proj4 string.
"""
# build a spatial reference
sr = SpatialReference()
# enter the proj4 string
valid_code = sr.ImportFromProj4('+proj=lcc +lat_1=25 +lat_2=25 +lat_0=25.0 +lon_0=-95.0 +R=6371229.0')
@john-science
john-science / build_your_own_lisp.md
Last active September 18, 2024 08:50
Build Your Own LISP

Build Your Own LISP

I had fun building my own LISP (Slow Loris). The project was extremely easy to get off the ground, because there a ton of resources to do just this. I thought it might be handy to have a little links round-up, based on my research.

In Python

There are already several good projects out there on writing your own LISP in Python.

Peter Norvig's LisPy

@john-science
john-science / git_primer.md
Last active April 26, 2016 19:13
A High-Level Git Introduction

A QUICK, high-level Git Introduction

The What, Why and How of starting your own private Git repo.

What:

Git is just a place for us all to keep our code/scripts/information.

What git does:

@john-science
john-science / web_comics.md
Last active October 11, 2016 22:41
Web Comics Links
@john-science
john-science / OOCheatSheet.java
Last active January 14, 2021 09:36
Java: an Objected Oriented Cheat Sheet
/**
* The basic class syntax.
*/
public class BasicClass {
public BasicClass() {
// This is the constructor.
}
@john-science
john-science / how_far_can_you_see.py
Last active August 29, 2015 14:18
How far can you see?
'''
How far away is the horizon?
How far away is that mountain?
How far away can something (on the Earth) be that I can still see it?
All good questions. Let's answer them.
'''
from math import sqrt
@john-science
john-science / HelloWorld.java
Last active June 15, 2020 23:31
Emoji in Java
/**
* A quick example of using Emoji in Java.
* compile with: javac HelloWorld.java
* run with: java HelloWorld
*/
public class HelloWorld {
public static void main(String[] args) {
String \u0ca2 = "Hello, World 1";
@john-science
john-science / smallest_lenses_for_sony_a7.md
Last active August 27, 2019 15:06
The smallest lenses adaptable to the Sony a7 (series)

Smallest Lenses Adaptable to the Sony a7

This has been moved to a blog post.

@john-science
john-science / bresenham_algo.py
Last active February 14, 2018 17:50
Bresenham's Line algorithm in 2D and 3D
"""
The Bresenham Algorithm creates a list of cells/pixels that a straight
line intersects in a grid/raster/bitmap.
This example script gives the Bresenham Algorithm in 2D and 3D.
"""
def main():
points_2d = bresenham_line_2d(0, 0, 6, 2)
@john-science
john-science / river_songs_timeline.md
Last active May 11, 2016 17:17
River Song's Timeline

River Song's Timeline

I want to re-watch all of the Doctor Who TV episodes with River Song, but from her timeline.

Beware, sometimes a single episode of Doctor Who shows River Song at two very different parts of her timeline. This is particularly true for the beginning of her timeline. The list below is the best we can do without breaking episodes into pieces.

River Song's Timeline - by Episode

Series Story Episode Name