Skip to content

Instantly share code, notes, and snippets.

View tormi's full-sized avatar
🇪🇪
Working from home

Tormi Tabor tormi

🇪🇪
Working from home
View GitHub Profile
#!/bin/bash
# Convert dwg to projected geojson
ogr2ogr -f GeoJSON -s_srs epsg:2154 -t_srs epsg:4326 building.json building.dwg
@tormi
tormi / geojson_to_index.js
Created November 2, 2020 12:30 — forked from thomasneirynck/geojson_to_index.js
Ingest geojson file into Elasticsearch index. Each feature in the FeatureCollection corresponds to a document in Elasticsearch.
const fs = require("fs");
const elasticsearch = require('elasticsearch');
const oboe = require('oboe');
const geojsonInput = process.argv[2] || 'feature_collection.geojson';
const indexname = process.argv[3] || geojsonInput.split('.')[0] || 'feature_collection';
const geometryFieldName = 'geometry';
const shape_type = process.argv[4] || 'geo_shape';
if (shape_type !== 'geo_point' && shape_type !== 'geo_shape') {
@tormi
tormi / script.js
Last active April 2, 2019 19:27 — forked from jmolivas/script.js
Trigger Netlify build from a Google Spreadsheet for Gatsby site
# From your Google Spreadsheet, select the menu item Tools > Script editor.
# Copy and paste this code.
# Replace uuid with the build_hooks uuid from your Netlify project.
# https://twitter.com/jmolivas/status/1112765435206787072
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Scripts')
.addItem('Build', 'build')
.addToUi();
@tormi
tormi / .lando.yml
Last active May 4, 2020 22:43
Gatsby with Lando
# Quickstart for Gatsby starter within Lando environment
#
# Install Lando v. >RC1.
# Place .lando.yml inside some directory and cd there.
# `git init . && git remote add origin https://github.com/gatsbyjs/gatsby-starter-default.git && git pull origin master`
# (feel free to use any starter repo URL).
# `lando start`.
# Use `lando` for commands available.
name: gatsby
@tormi
tormi / website-checker.sh
Created November 5, 2018 16:26 — forked from dominic-p/website-checker.sh
This is a shell script to check a provided list of URLs to see if the websites are working or not. It was based on the answers provided to this question: http://stackoverflow.com/q/21391776/931860
#!/bin/sh
# ---- website-checker.sh ----
# Pings a list of websites using cURL to see if they are up and
# there are no errors. If there are problems, we send an email using mailx
# to let ourselves know about the problem.
################################################################################
# Recipient of the errors email
admin_email=youremail@host.com
@tormi
tormi / leaflet.fullhash.js
Created September 14, 2017 12:12 — forked from relet/leaflet.fullhash.js
leaflet.fullhash.js
(function(window) {
var HAS_HASHCHANGE = (function() {
var doc_mode = window.documentMode;
return ('onhashchange' in window) &&
(doc_mode === undefined || doc_mode > 7);
})();
L.Hash = function(map, options) {
this.onHashChange = L.Util.bind(this.onHashChange, this);
@tormi
tormi / kiirtee.geojson
Last active September 9, 2017 09:41
Kiirtee Saue linnast Keilasse ja Tallinna
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / overpass.geojson
Created May 26, 2017 11:30 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / bootstrap-3-nav-menu-responsive-brand-logo-image.markdown
Created January 19, 2017 11:58
Bootstrap 3 Nav Menu Responsive Brand Logo Image

Bootstrap 3 Nav Menu Responsive Brand Logo Image

This demo corresponds to a this question answered on stackoverflow about Bootstrap Navbar Logos

There is a bug in Firefox with the bootstrap navbar-brand image. These methods above FIX the firefox issue by applying padding to the image and not the .navbar-brand tag removing the padding on .navbar-brand.

If you're looking for my original post using object fit method I have removed it for now because it is not fully supported in IE without a polyfill or fallback using css tables.

These are all examples of how to use a logo image in the bootstrap nav using tag. Using height on the logo along with width: auto, the image will resize to fit within the navbar and not overflow onto the page. This works exactly the same way .img-responsive does except in reverse. However, there is currently a bug in firefox so we have to apply the padding to the im