Skip to content

Instantly share code, notes, and snippets.

@tanc
tanc / gridsome.server.js
Last active November 21, 2021 17:34
Fetch and process remote files in Gridsome
const path = require('path')
const fs = require('fs')
const Queue = require(`better-queue`)
const child_process = require('child_process')
const remoteimageQueue = new Queue(
(input, cb) => {
downloadImage(input)
.then(r => cb(null, r))
.catch(e => cb(e))
@tanc
tanc / gridsome.server.js
Created August 1, 2019 14:27
Cockpit to Gridsome - Download assets (images)
const path = require('path')
const axios = require('axios')
const fs = require('fs')
const languages = [
'en',
]
class gridsomeSetup {
static defaultOptions () {
@tanc
tanc / docker-compose.yml.patch
Last active March 29, 2018 06:50
Patches for wodby/docker4drupal v5.x
--- docker-compose.yml 2018-03-27 16:25:27.000000000 +0200
+++ docker-compose.yml.agile 2018-03-29 08:49:57.000000000 +0200
@@ -10,6 +10,8 @@
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
+ ports:
+ - 3306:3306
# volumes:
# - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
@tanc
tanc / docker-site
Created February 14, 2018 08:39
Set up a new docker-site
#!/bin/bash
###
# Prepares a docker4drupal based docker set up.
#
# Should be run in the directory above the gitroot and should not be committed
# to any repositories.
#
# Will fetch the latest docker-compose.yml file from docker4drupal repo,
# then will fetch the patch file for the specified Drupal version and will
@tanc
tanc / settings.local.php
Created February 12, 2018 15:15
settings.local.php
<?php
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of
* 'sites/default/settings.php' and uncomment the commented lines that mention
* 'settings.local.php'.
@tanc
tanc / Patches for docker4drupal.md
Last active April 25, 2018 09:08
Patches for wodby/drupal4docker

The following files contain patches for Drupal 7 and Drupal 8 versions of docker-compose.yml from wodby/drupal4docker. These patches prepare a default set up for the Agile Collective Drupal file structure.

Uncaught AjaxError:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/block/library/fsl_theme?region=header
StatusText: OK
ResponseText:
Place block | Financing Sustainable Landscapes
Skip to main content
Toolbar items
@tanc
tanc / wifikeepalive.applescript
Created December 17, 2012 17:58
An Applescript which checks for a working WiFi connection and on failure restarts WiFi. I use it with launchd and run it every 30 seconds as I have a sometimes inconsistent 3G tethered connection.
# Airport toggling based on a script by nomadcoder:
# Toggle WiFi: https://github.com/nomadcoder/launchbar-scripts/blob/master/Toggle%20WiFi.applescript
#
# The purpose of this script is to check to see whether the wifi connection can reach the
# internet and if unsuccessful restarts the wifi connection.
#
# I personally run it every 30 seconds as a launchd job.
# Fetch the name of your AirPort Device
set airPortDevice to do shell script "/usr/sbin/networksetup -listallhardwareports | awk '{if($3==\"Wi-Fi\"){getline;print}}' | awk '{print $2}'"