Skip to content

Instantly share code, notes, and snippets.

@hhimanshu
hhimanshu / Scala.For.The.Impatient.md
Last active September 28, 2021 15:51
Scala for the Impatient Exercises

This gist will contain all the exercises from the book

@perrygeo
perrygeo / rasterize.py
Created April 30, 2015 19:23
rasterize gdal vs rasterio
def rasterize_geom(geom, src_offset, new_gt, all_touched):
from rasterio import features
geoms = [(geom, 1)]
rv_array = features.rasterize(
geoms,
out_shape=(src_offset[3], src_offset[2]),
transform=new_gt,
fill=0,
all_touched=all_touched)
return rv_array

When you modify a file in your repository, the change is initially unstaged. In order to commit it, you must stage it—that is, add it to the index—using git add. When you make a commit, the changes that are committed are those that have been added to the index.

git reset changes, at minimum, where your current branch is pointing. The difference between --mixed and --soft is whether or not your index is also modified. So, if we're on branch master with this series of commits:

- A - B - C (master)

HEADpoints to C and the index matches C.

--soft

@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active April 3, 2024 13:55
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@kalxas
kalxas / README.md
Last active November 4, 2021 17:25
INSPIRE validation

Inspire Validation using OWSLib

Installation steps

  1. Create virtualenv:

    $ virtualenv owslib_test

@XVilka
XVilka / TrueColour.md
Last active May 28, 2024 17:42
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@mattratleph
mattratleph / vimdiff.md
Last active May 9, 2024 03:11 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@mbostock
mbostock / .block
Last active March 1, 2024 06:07
The Gist to Clone All Gists
license: gpl-3.0
@sgillies
sgillies / geo_interface.rst
Last active May 29, 2024 12:49
A Python Protocol for Geospatial Data

Author: Sean Gillies Version: 1.0

Abstract

This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.

Introduction