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
@danalloway
danalloway / migrate-gcs-supabase.js
Last active July 18, 2024 01:14
Migrate Google Cloud Storage (GCS) to Supabase Storage
/**
* 1.) Make sure you have the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
* set to the path of your local service account credentials.
* @see https://cloud.google.com/storage/docs/reference/libraries#setting_up_authentication
*
* 2.) Make sure you have the `SUPABASE_URL` and `SUPABASE_KEY` environment variables set
* with the proper values from your Supabase Project API page.
*
* Install dependancies: `npm install --save node-fetch form-data @google-cloud/storage`
*/
@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') {
@dustinleblanc
dustinleblanc / .lando.yml
Last active August 4, 2019 23:11
Setting up Lando with Browsersync
proxy:
node:
- appname-bs.lndo.site:3000
services:
node:
type: node
# Change as needed
build:
- "cd /app && yarn install"
- "cd /app && yarn dev"
@jmolivas
jmolivas / script.js
Last active February 6, 2021 16:21
Trigger Netlify build from a Google Spreadsheet
# 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.
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Scripts')
.addItem('Build', 'build')
.addToUi();
}
@adamzimmermann
adamzimmermann / migrate.sh
Last active June 27, 2024 12:37
Migration Script with Limit/Looping
#!/bin/bash
migrate_loop()
{
# Better readability with separation.
echo "========================";
# Get the output of the drush status.
drush_output=$(drush ms "$1" --format string);
# Split output string into an array.
@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
@smcatala
smcatala / README.md
Last active February 7, 2021 19:48
use @storybook/react (^5.1) with inferno & typescript
/**
 * Copyright 2019
 * @author Stephane M. Catala
 * @license Apache Version 2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
@mortenson
mortenson / composer.json
Last active August 20, 2023 10:39
Example composer.json file for File Browser
{
"name": "mortenson/example",
"minimum-stability": "dev",
"authors": [
{
"name": "Samuel Mortenson",
"email": "samuel.mortenson@acquia.com"
}
],
"repositories": [
<?php
/**
* @file
* Default theme implementation to display the basic html structure of a single
* Drupal page.
*
* Variables:
* - $css: An array of CSS files for the current page.
* - $language: (object) The language the site is being displayed in.
@benbalter
benbalter / csv-to-geojson.sh
Created June 25, 2015 07:11
Convert CSVs to GeoJSON, in bulk
#!/bin/bash
# Convert CSVs to GeoJSON, in bulk
# Usage: ./csv-to-geojson.sh [URL to list of CSV files]
# Outputs geoJSON files to the `output` folder
# Install csv2geojson if it's not installed
type csv2geojson || npm install -g csv2geojson
# Cleanup
rm -Rf ./tmp