A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()):
- Headers
- Links
- Bold
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()):
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Tournament Bracket Generator</title> | |
| <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
| <script src="http://underscorejs.org/underscore-min.js"></script> | |
| <script> | |
| $(document).on('ready', function() { | |
| var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes) |
| RewriteEngine on | |
| # If the request is not for a valid directory | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| # If the request is not for a valid file | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| # If the request is not for a valid link | |
| RewriteCond %{REQUEST_FILENAME} !-l |
| jQuery(function($){ | |
| function debug(str) { | |
| if (settings.debug) { console.log(str); } | |
| } | |
| // Helper methods | |
| var helper = { | |
| }; |
| var MyModule = (function($, Modernizr) { | |
| // Module variables. Use for local tracking | |
| var data = { | |
| } | |
| // Module init; This will run during onready if module is defined in the <body> data attribute | |
| var init = function() { | |
| _debug("main.init()"); |
| .DS_Store | |
| .AppleDouble | |
| .LSOverride | |
| Icon | |
| ._* | |
| .Spotlight-V100 | |
| .Trashes | |
| Thumbs.db | |
| ehthumbs.db | |
| Desktop.ini |
| function ajax(url, callback) { | |
| var xmlhttp; | |
| xmlhttp = new XMLHttpRequest(); | |
| xmlhttp.onreadystatechange = function() { | |
| if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { callback(xmlhttp.responseText); } | |
| } | |
| xmlhttp.open("GET", url, true); | |
| xmlhttp.send(); | |
| } |
Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.
// Locks the page if it's currently unlocked
$.scrollLock();
// ...or vice versa
I have following object:
var cities={10:'Tashkent', 14:'Karakalpakiya', 16:'Andijan'};I want sort it by city names, so after sort it should be:
var cities={16:'Andijan', 14:'Karakalpakiya', 10:'Tashkent'};But I can't sort object properties, instead can convert object into array, then sort items.
| /* | |
| My Plugin | |
| The description/summary of the plugin | |
| 5/21/14 ~BV | |
| Syntax: | |
| $(selector).myPlugin(options) | |
| Usage: |