Skip to content

Instantly share code, notes, and snippets.

<script>
// Based on code from https://stackoverflow.com/questions/59629947/how-do-i-load-an-external-js-library-in-svelte-sapper
import { onMount, createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
export let src;
export let libraryDetectionObject;
let script;
onMount(() => {
Warning: Quoted references are deprecated
on .terraform/modules/slipway-network-frontend/network/main.tf line 21, in resource "google_dns_record_set" "default":
21: provider = "google.dnseditor"
In this context, references are expected literally rather than in quotes.
Terraform 0.11 and earlier required quotes, but quoted references are now
deprecated and will be removed in a future version of Terraform. Remove the
quotes surrounding this reference to silence this warning.
This file has been truncated, but you can view the full file.
2019/11/28 22:39:34 [INFO] Terraform version: 0.12.16
2019/11/28 22:39:34 [INFO] Go runtime version: go1.12.13
2019/11/28 22:39:34 [INFO] CLI args: []string{"/home/hallvord/.local/bin/terraform", "apply", "-var", "service_account_file=/home/hallvord/repos/capua/config/local-secrets/sj-hjem-temp-9d5395117d01.json", "-var", "service_account_file_dns=/home/hallvord/repos/minus-test-dns-76c6ab29b0b5.json", "-var", "project_appname=capua", "-var", "target_environment=staging", "-var", "google_project_name=sj-hjem-temp", "-var", "google_dns_project_name=minus-test-dns", "-var", "google_region=europe-north1", "-var", "google_zone=europe-north1-a", "-var", "project_repository=git@github.com:minus/capua.git", "-var", "branch=master", "-var", "update_disk_link=https://www.googleapis.com/compute/v1/projects/sj-hjem-temp/zones/europe-north1-a/disks/capua-updatevm-disk", "-var", "img_name=capua-master-20191128-2137"}
2019/11/28 22:39:34 [DEBUG] Attempting to open CLI config file: /home/hallvord/.terraformrc
2019/11/28 2
@hallvors
hallvors / object-assign.js
Created February 20, 2017 12:21
Slightly modified object-assign code to set Object.assign directly rather than being a node module
// https://github.com/sindresorhus/object-assign
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
(function(){
'use strict';
/* eslint-disable no-unused-vars */
import java.io.*;
public class MakePDF {
/*
* Instantiates a Prince object
*/
public static class MessageListener implements com.princexml.PrinceEvents{
public void onMessage(String msgType,
String msgLocation,
<!DOCTYPE html><html>
<head><title>Exclude some pages from numbering</title>
<link rel="help" href="http://www.princexml.com/forum/topic/3492/is-it-possible-to-skip-numbering-a-named-page-group">
<script type="text/javascript">
(function(){
// This list can be customized by hand or auto-generated
var pages = {"3":1,"4":2,"5":3,"6":4,"8":5,"9":6}
// If you wish to auto-generate the list, add
@hallvors
hallvors / kuromoji-helper.js
Last active September 23, 2016 11:53
Helper script for better Japanese line wrapping, using Kuromoji tokenizer library
kuromoji.builder({ dicPath: "node_modules/kuromoji/dict/" }).build(function (err, tokenizer) {
if(err)console.log(err);
var textNodesUnder = function(node){ // http://stackoverflow.com/questions/10730309/find-all-text-nodes-in-html-page
var all = [];
for (node=node.firstChild;node;node=node.nextSibling){
if (node.nodeType==3 && !/^\s+$/.test(node.data)) all.push(node);
else all = all.concat(textNodesUnder(node));
}
return all;
};
@hallvors
hallvors / extract_domain_name.py
Created March 21, 2016 08:36
Using tldextract to remove www. safely and extract the domain name and its public suffix
def extract_domain_name(url):
'''Extract the domain name from a given URL'''
prefix_blacklist = ['www']
parts = tldextract.extract(url)
# We want to drop any prefixes mentioned in the blacklist
# They typically do not add information that's useful to
# distinguish the "identity" of a specific site
# Sometimes the blacklisted domain is part of subdomain,
# for example when parsing www.mail.example.com
var btn = document.getElementById("copy-button");
btn.addEventListener("click", clickHandler, false);
function clickHandler(e) {
document.exeCommand('copy');
}
@hallvors
hallvors / yui-lightbox.js
Created January 22, 2014 09:07
some of the code that runs the lightbox feature on flickr.com
function k(aC, aG, aJ) {
var aI, aD, aO, aM, aP, aF = true, aL, Y;
if (aC) {
aI = K(aC)
} else {
return
}
var aN = at().width;
if (aC.get("needs_interstitial")) {
aF = true