// jQuery
$(document).ready(function() {
// code
})| //ROUTER | |
| //Silly small javascript router to help me learn how they worked in a very simple way | |
| (function (){ | |
| const appDiv = "app"; | |
| // Both set of different routes and template generation functions | |
| let routes = {}; | |
| let templates = {}; |
| //var csv is the CSV file with headers | |
| function csvJSON(csv){ | |
| var lines=csv.split("\n"); | |
| var result = []; | |
| var headers=lines[0].split(","); | |
| for(var i=1;i<lines.length;i++){ |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.