Debounce a function when you want it to execute only once after a defined interval of time. If the event occurs multiple times within the interval, the interval is reset each time.
Example A user is typing into an input field and you want to execute a function, such as a call to the server, only when the user stops typing for a certain interval, such as 500ms.
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"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/vegas/2.3.1/vegas.css" rel="stylesheet" type="text/css" /> | |
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
| // Documentation: https://github.com/beautify-web/js-beautify | |
| // Example URL: https://github.com/victorporof/Sublime-HTMLPrettify/blob/master/.jsbeautifyrc | |
| // Based on Airbnb's JavaScript Style Guide, URL: https://github.com/airbnb/javascript | |
| { | |
| // Collapse curly brackets | |
| "brace_style": "collapse", | |
| // Break chained method calls across subsequent lines | |
| "break_chained_methods": true, |
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
| Driver: | |
| -Write the code according to the navigator's specification | |
| -Listen intently to the navigators instructions | |
| -Ask questions wherever there is a lack of clarity | |
| -Offer alternative solutions if you disagree with the navigator | |
| -Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on | |
| -Make sure code is clean | |
| -Own the computer / keyboard | |
| -Ignore larger issues and focus on the task at hand | |
| -Trust the navigator - ultimately the navigator has the final say in what is written |
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
| // PhantomJS Cheatsheet | |
| $ brew update && brew install phantomjs // install PhantomJS with brew | |
| phantom.exit(); | |
| var page = require('webpage').create(); | |
| page.open('http://example.com', function() {}); | |
| page.evaluate(function() { return document.title; }); |
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
| MIT License | |
| Copyright (c) 2014 Piotr Kuczynski | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
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
| <?php | |
| /** | |
| * | |
| * This removes the ability to add the FULL image size into a post, it does not alter or delete the image | |
| * Add whataever extra image sizes to the insert dropdown in WordPress you create via add_image_size | |
| * | |
| * For now we have to do it this way to make the labels translatable, see trac ref below. | |
| * | |
| * If your theme has $content_width GLOBAL make sure and remove it |
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
| #!/bin/bash | |
| # Functions ============================================== | |
| # return 1 if global command line program installed, else 0 | |
| # example | |
| # echo "node: $(program_is_installed node)" | |
| function program_is_installed { | |
| # set to 1 initially | |
| local return_=1 |
NewerOlder