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 config --global alias.ac '! git add -A && git commit -m' |
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 basic_auth (req, res, next) { | |
| if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) { | |
| // fetch login and password | |
| if (new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString() == 'usernamehere123:passwordhere123') { | |
| next(); | |
| return; | |
| } | |
| } | |
| console.log('Unable to authenticate user'); | |
| console.log(req.headers.authorization); |
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> | |
| <meta charset=utf-8> | |
| <title>Brap.</title> | |
| <style> | |
| * { margin: 0; padding: 0; } | |
| /** etc **/ | |
| </style> | |
| <body> | |
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
| $('.toggler').bind('change', function() { | |
| var showIt = !$(this).is(':checked'); | |
| var panel = $(this).closest('.field').nextAll('.hide'); | |
| panel.changeVisibility(showIt) | |
| .closest('fieldset').changeClass('featured', showIt); | |
| }); |
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
| // Helper classes | |
| $.fn.changeClass = function(className, add) { | |
| add = add || false; | |
| return this.each(function() { | |
| if(add) { | |
| $(this).addClass(className); | |
| } | |
| else { | |
| $(this).removeClass(className); |
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
| $('.toggler').change(function() { | |
| var showIt = !$(this).is(':checked'); | |
| var panel = $(this).closest('.field').nextAll('.hide'); | |
| if(showIt) { | |
| panel.show().closest('fieldset').addClass('featured'); | |
| } | |
| else { | |
| panel.hide().closest('fieldset').removeClass('featured'); | |
| } | |
| }); |
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($) { | |
| // Static constructs | |
| $.motionlab = $.motionlab || {}; | |
| $.motionlab.simpleScroll = { | |
| conf: { | |
| auto_slide: 0, | |
| hover_pause: 0, | |
| auto_slide_seconds: 1000 | |
| } |
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
| api.onSlide(function(where) { | |
| alert('You just did some sliding to the ' + where); | |
| }); |
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
| // add a "fire" variable, below the self variable, that will cover both the current instance and the root variable. | |
| var self = this, | |
| fire = root.add(self); | |
| ///////////////////////// | |
| // then insert calls to the custom functions in all the necessary places, e.g. in the slide function -- | |
| $.extend(self, { |
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
| $('.carousel ul').each(function() { | |
| var ul = $(this); | |
| ul.simpleScroll({ | |
| auto_slide: 1, | |
| hover_pause: 1 | |
| }); | |
| // Aha! There's our data object we created inside the plugin. Luckily, this gives us access to everything that SimpleScroll had to offer. | |
| var api = ul.data('simpleScroll'); |