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
| #!/usr/bin/env bash | |
| # checck if pidof exists | |
| PIDOF="$(which pidof)" | |
| # and if not - install it | |
| (test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof | |
| # find app in default paths | |
| CO_PWD=~/Applications/CrossOver.app/Contents/MacOS | |
| test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS |
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
| .ProseMirror[data-placeholder]::before { | |
| color: global.$placeholder-colour; | |
| position: absolute; | |
| content: attr(data-placeholder); | |
| pointer-events: none; | |
| } |
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
| vi /etc/environment | |
| add these lines... | |
| LANG=en_US.utf-8 | |
| LC_ALL=en_US.utf-8 |
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
| // 'downloadFile.js', written by blending two solutions: | |
| // 'js-download' https://github.com/kennethjiang/js-file-download | |
| // 'Anders Paulsen' https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/ | |
| export function downloadFile(data, filename, mime) { | |
| // It is necessary to create a new blob object with mime-type explicitly set | |
| // otherwise only Chrome works like it should | |
| const blob = new Blob([data], {type: mime || 'application/octet-stream'}); | |
| if (typeof window.navigator.msSaveBlob !== 'undefined') { | |
| // IE doesn't allow using a blob object directly as link href. |
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
| new Date(seconds * 1000).toISOString().substr(11, 8) |
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
| // Add on element with overflow | |
| -webkit-mask-image: -webkit-radial-gradient(white, black); |
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
| # most people include something like this. don't. | |
| # check your default nginx.conf, it's already covered in a much better way. | |
| #gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | |
| # compress proxied requests too. | |
| # it doesn't actually matter if the request is proxied, we still want it compressed. | |
| gzip_proxied any; | |
| # a pretty comprehensive list of content mime types that we want to compress | |
| # there's a lot of repetition here because different applications might use different |
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
| var path = require('path'); | |
| module.exports = (function () { | |
| return path.dirname(require.main.filename || process.mainModule.filename); | |
| })(); | |
| // Example of usage: | |
| var root = require('root'); // In root will be absolute path to your application |