https://sublime.wbond.net/installation#st3
- Source Code Pro -
sourcecodepro.sh - Hack -
hack.sh
https://sublime.wbond.net/installation#st3
sourcecodepro.shhack.sh| <?php | |
| /** | |
| * Take a WPDB query result and display it as a table, with headers from data keys. | |
| * This example only works with ARRAY_A type result from $wpdb query. | |
| * @param array $db_data Result from $wpdb query | |
| * @return bool Success, outputs table HTML | |
| * @author Tim Kinnane <[email protected]> | |
| * @link http://nestedcode.com | |
| */ |
NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.
I'd like to hear how you approach this: @valuedstandards or comment on this gist.
You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |
| /** | |
| * Convert text containing newlines to paragraph'd markup. | |
| * | |
| * @param {String} text Text to add p tags to | |
| * | |
| * @return {String} Returns paragraphized text | |
| */ | |
| function autoParagraph ( text ) { | |
| return '<p>' + text.split( /\n+/ ).join( '</p>\n<p>' ) + '</p>'; | |
| } |
| // This will open up a prompt for text to send to a console session on digital ocean | |
| // Useful for long passwords | |
| (function () { | |
| var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split(""); | |
| function f() { | |
| var character = t.shift(); | |
| var i=[]; | |
| var code = character.charCodeAt(); | |
| var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1 |
| //Example 1 - Calculate average value of an array (transform array into a single number) | |
| var scores = [89, 76, 47, 95] | |
| var initialValue = 0 | |
| var reducer = function (accumulator, item) { | |
| return accumulator + item | |
| } | |
| var total = scores.reduce(reducer, initialValue) | |
| var average = total / scores.length | |
| /*Explain about function |
prettier-eslint |
eslint-plugin-prettier |
eslint-config-prettier |
|
|---|---|---|---|
| What it is | A JavaScript module exporting a single function. | An ESLint plugin. | An ESLint configuration. |
| What it does | Runs the code (string) through prettier then eslint --fix. The output is also a string. |
Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. | This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb. |
| How to use it | Either calling the function in your code or via [prettier-eslint-cli](https://github.co |
| /** | |
| * Advanced Custom Fields Google Maps integration | |
| * | |
| * @link https://www.advancedcustomfields.com/resources/google-map/ | |
| * @example | |
| * <?php $location = get_field( 'location' ); ?> | |
| * <div class="acf-map"> | |
| * <div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div> | |
| * </div> | |
| */ |
| .flex { | |
| display: flex; | |
| .align-center { | |
| margin: auto; | |
| align-self: center; | |
| } | |
| .align-left { | |
| margin-right: auto; |