This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.directive('focus', { | |
update: function (el) { | |
if (!el.offsetParent) { // element not visible | |
el.dataset.focused=false; | |
} else if (el.dataset.focused!=="true") { // focus hasn't been forced yet | |
el.dataset.focused=true; | |
el.focus(); | |
} | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- before: data_json = {object: {id: 123, result: null}} | |
-- after: data_json = {object: {id: 123}} | |
UPDATE events | |
SET data_json = data_json::jsonb #- '{object,result}' | |
WHERE json_typeof(data_json->'object'->'result') = 'null'; |
If you have multiple applications on Heroku and would like to use a single Logentries account for all of them, this is how you do it. Basically, do not use add-ons, and send all drains to your account.
- In your Logentries account, click on
Add Log
- Select
Manual
- In the form that appears, input the following:
- Log Name:
access.log
- Select Set:
new
set namedmyapp-{environment}
, for instancemyapp-staging
(at least, this is how I like to name my entries) - Select the
Plain TCP, UDP - logs are sent via syslog
option
- Log Name:
- Click on
Create Log Token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Angular JS</title> | |
</head> | |
<body ng-app="jsbin"> | |
<div ng-controller="DemoCtrl as demo"> | |
<h1>Hello {{demo.name}}</h1> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// traditional | |
if (this.currentView == 'gantt') { | |
this.currentView = 'table'; | |
} else { | |
this.currentView = 'gantt'; | |
} | |
// tricky | |
var toggle = {'gantt' : 'table', 'table' : 'gantt'} | |
this.currentView = toggle[this.currentView]; |
NewerOlder