Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcus Ramberg marcusramberg

View GitHub Profile
View gist:cf623b20880000ace36fea26e5005cad
diff --git a/lib/Mojolicious/Plugin/DefaultHelpers.pm b/lib/Mojolicious/Plugin/DefaultHelpers.pm
index 5226026cf..c6b983e6e 100644
--- a/lib/Mojolicious/Plugin/DefaultHelpers.pm
+++ b/lib/Mojolicious/Plugin/DefaultHelpers.pm
@@ -173,7 +173,9 @@ sub _is_fresh {
sub _log {
my $c = shift;
return $c->stash->{'mojo.log'}
- ||= $c->app->log->context('[' . $c->req->request_id . ']');
+ ||= $c->app->log->can('context')
View gist:d22fae35c86191d931ee3778c5be9e84
diff --git a/lib/Mojolicious/Plugin/DefaultHelpers.pm b/lib/Mojolicious/Plugin/DefaultHelpers.pm
index 5226026cf..db04ef688 100644
--- a/lib/Mojolicious/Plugin/DefaultHelpers.pm
+++ b/lib/Mojolicious/Plugin/DefaultHelpers.pm
@@ -173,7 +173,9 @@ sub _is_fresh {
sub _log {
my $c = shift;
return $c->stash->{'mojo.log'}
- ||= $c->app->log->context('[' . $c->req->request_id . ']');
+ ||= $c->app->log->can('context'
View gist:e7a43a23c5ee46df49f3a3b444d83974
2019-08-11 20:54:02 ERROR (MainThread) [hass_nabucasa.iot] Error handling message
Traceback (most recent call last):
File "/home/marcus/homeassistant/lib/python3.7/site-packages/hass_nabucasa/iot.py", line 220, in _handle_connection
self.cloud, msg["handler"], msg["payload"]
File "/home/marcus/homeassistant/lib/python3.7/site-packages/hass_nabucasa/iot.py", line 274, in async_handle_message
return await handler(cloud, payload)
File "/home/marcus/homeassistant/lib/python3.7/site-packages/hass_nabucasa/iot.py", line 286, in async_handle_google_actions
return await cloud.client.async_google_message(payload)
File "/home/marcus/homeassistant/lib/python3.7/site-packages/homeassistant/components/cloud/client.py", line 147, in async_google_message
self._hass, self.google_config, self.prefs.cloud_user, payload
View gist:a6d869acf913290a08a50462a146a190
diff --git a/ansible/roles/legacy-lb/templates/etc/varnish/default.vcl.varnish4.j2 b/ansible/roles/legacy-lb/templates/etc/varnish/default.vcl.varnish4.j2
index 75e054be..cd66b934 100644
--- a/ansible/roles/legacy-lb/templates/etc/varnish/default.vcl.varnish4.j2
+++ b/ansible/roles/legacy-lb/templates/etc/varnish/default.vcl.varnish4.j2
@@ -226,7 +226,7 @@ sub vcl_recv {
if (req.url ~ "^/(club|klubb|klub|artikler|artiklar|kampanje|kampanj|kampagne|kampania)"
|| req.url ~ "^/(asset|cdn|component|layouts|services)/"
|| req.url ~ "^/(afbudsrejser|sistaminuten)(/|\.json|)(\?.+)?$"
- || req.url ~ "^/(charter|charterredirect|feature|hotel|services|status/[0-9]+$)"
+ || req.url ~ "^/($|charter|charterredirect|feature|hotel|services|status/[0-9]+$)"
View gist:e3d6f0f9e53914fe844432881784dd5a
def namespace(arg)
end
def help()
end
def there()
end
def is()
end
def no()
View gist:04021581f7f6d7b99daec5543dcd036f
diff --git a/README.md b/README.md
index 060403106..93f2966d2 100644
--- a/README.md
+++ b/README.md
@@ -44,6 +44,14 @@
high quality spin-off projects like the
[Minion](https://metacpan.org/pod/Minion) job queue.
+## Benefits
+
View gist:d2bd303cad9dcc34e259d55f1e04958e
Error: Unsupported argument
on .terraform/modules/gce-lb-http/main.tf line 79, in resource "google_compute_backend_service" "default":
79: backend = [ var.backends[count.index] ]
An argument named "backend" is not expected here. Did you mean to define a
block of type "backend"?
View gist:258610cbf254caee425bf0ae1f6e9bb9
diff --git a/assets/components/SidebarChat.svelte b/assets/components/SidebarChat.svelte
index 1b1a6bcf..70be23ec 100644
--- a/assets/components/SidebarChat.svelte
+++ b/assets/components/SidebarChat.svelte
@@ -10,31 +10,30 @@ let unread = 0;
const api = getContext('api');
const byName = (a, b) => a.name.localeCompare(b.name);
-function loadConversations() {
- api.execute('getUser', {
View gist:b5e71c6e8e2d5ea7ee896251e4f5620f
#!/usr/bin/perl -w
use YAML;
my $yaml=Load('---
a:
b: 1
c: 2
e: 3');
$yaml->{a}->{d}=2;
View gist:c445646a81b73fcee6e77429bd12bfea
diff --git a/lib/Mojo/Promise.pm b/lib/Mojo/Promise.pm
index 19fdd8617..a84ff6006 100644
--- a/lib/Mojo/Promise.pm
+++ b/lib/Mojo/Promise.pm
@@ -2,6 +2,7 @@ package Mojo::Promise;
use Mojo::Base -base;
use Mojo::IOLoop;
+use Mojo::Util 'deprecated';
use Scalar::Util 'blessed';