Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| // gets a stream of images, reads the exif data, and adjusts orientation appropriately | |
| // piexif: https://github.com/hMatoba/piexifjs | |
| var imgs = document.querySelectorAll("img") | |
| // main part | |
| imgs.forEach( img => { | |
| toDataURL(img.src) | |
| .then( xhr => resToBlob(xhr.response) ) | |
| .then( blob => { |
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 onOpen() { | |
| var ui = SpreadsheetApp.getUi(); | |
| ui.createMenu('Update Jobs') | |
| .addItem('Get New Jobs','getNewestJobs') | |
| .addToUi(); | |
| } | |
| function fetchModeData() { | |
| var options = { | |
| headers: { |
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 trimBST = function(root, L, R) { | |
| if (root === null) { | |
| return null; | |
| } | |
| root.left = trimBST(root.left, L, R); | |
| root.right = trimBST(root.right, L, R); | |
| if (root.val < L) { | |
| return root.right; |
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 mergeTrees = function(t1, t2) { | |
| let sum; | |
| let leftNode1 = null; | |
| let leftNode2 = null; | |
| let rightNode1 = null; | |
| let rightNode2 = null; | |
| if (t1 === null && t2 === null) { | |
| return null; | |
| } else if (t1 === null) { |
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
| git remote rm heroku | |
| heroku git:remote -a newname | |
| https://devcenter.heroku.com/articles/renaming-apps#updating-git-remotes |
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 reverse = function(x) { | |
| let num = x > 0 ? x : -x; | |
| let reversedNum = Number(num.toString().split('').reverse().join('')); | |
| //for overflow | |
| if ( (reversedNum >> 0) !== reversedNum ) { | |
| return 0; | |
| } | |
| return x > 0 ? reversedNum : -reversedNum; |
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
| let fs = require ('fs'); | |
| let dir = '/root/devops'; | |
| fs.readdir(dir, 'utf8', (err, data) => { | |
| if (err) { | |
| console.log("ERROR! ", err); | |
| return; | |
| } else { | |
| //console.log("SUCCESS! ", data); | |
| readFiles(data); |
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
| https://github.com/neosergio/Latam-Keyboard |
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
| Things like snippets tend to gravitate towards the bottom. | |
| To bump them to the top, despite their length, add this to your VSCode settings: | |
| "editor.snippetSuggestions": "top" | |
| "Print to console": { | |
| "prefix": "cons", | |
| "body": [ | |
| "console.log('$1');", | |
| ], | |
| "description": "Log output to console" |
NewerOlder