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
| # ----------------------------------------------------------------------------- | |
| # low disk space | |
| # checking the latest collected values | |
| # raise an alarm if the disk is low on | |
| # available disk space | |
| template: disk_space_usage | |
| on: disk.space | |
| families: * |
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
| maim -s | xclip -selection clipboard -t image/png |
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
| I'd several files like | |
| image.png | |
| image-transparent.png | |
| image3.png | |
| image3-transparent.png | |
| ...lot files... | |
| I needed rename and remplace for instance image-transparent.png for image.png | |
| so in the folder |
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
| Install with sudo apt install autorandr (tested on Ubuntu 18.04) | |
| Configure your monitor to your liking with xrandr | |
| Store your configuration with autorandr --save work (I'm storing my work config, choose a name that suits you) | |
| Resume the config with autorandr --change work to choose config, or just autorandr --change to have it infer your config from your connected monitors. | |
| XDG autostart .desktop is also provided, and installed into /etc/xdg/autostart/autorandr.desktop by default. |
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
| <script> | |
| function loadNonLocalScriptSync(href) { | |
| var f=document.getElementsByTagName('script')[0], | |
| j=document.createElement('script'); | |
| // Simulate <script> faithfully | |
| j.async=false; | |
| j.src=href; | |
| f.parentNode.insertBefore(j,f); | |
| }; |
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
| //con callbacks debes pasar el callback, cuyo argumento se va a resolver en un futuro...en el siguiente ejemplo el valor de database | |
| //se resolverá en el futuro, luego book y luego user | |
| connectDatabase(function(database){ | |
| findAllBooks(database,function(book){ | |
| getCurrentUser(database,function(user){ | |
| return pickTopRecommendation(books, user); | |
| }) | |
| }) | |
| }) |
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
| function promisify(func) { | |
| return (...args) => | |
| new Promise((resolve, reject) => { | |
| const callback = (err, data) => err ? reject(err) : resolve(data) | |
| func.apply(this, [...args, callback]) | |
| }) | |
| } | |
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
| For other users who just want to download a file/folder from github, simply use: | |
| svn export <repo>/trunk/<folder> | |
| e.g. | |
| svn export https://github.com/lodash/lodash.com/trunk/docs | |
| (yes, that's svn here. apparently in 2016 you still need svn to simply download some github files) | |
| Courtesy: Download a single folder or directory from a GitHub repo |
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
| const ROOT_SOCKET = `wss://${URL}/socket`; | |
| let socket = new Socket(ROOT_SOCKET); | |
| socket.connect() | |
| let chan = socket.channel("connect:" + guid()); | |
| chan.join(); | |
| and then I could create a mutation for load the callbacks and call this from my main component | |
| someMutation(state) { |
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
| inxi -Fxxxz |