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 | |
| // Non-admins can't login, they're redirected to the video/videos page, | |
| // which stops them from messing with the website. | |
| $goodbye = site_url(); | |
| function force_login_redirect( $redirect_to, $request, $user ) { | |
| return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : $goodbye; | |
| } | |
| add_filter( 'login_redirect', 'force_login_redirect', 10, 3 ); |
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
| var jq = document.createElement('script'); | |
| jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
| document.getElementsByTagName('head')[0].appendChild(jq); | |
| <!-- Wait! --> | |
| jQuery.noConflict(); |
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
| <object class="svg" data-fallback="/library/images/icons/twitter.png"> | |
| <?php include_once(TEMPLATEPATH .'/library/images/icons/twitter.svg'); ?> | |
| </object> | |
| <style type="scss"> | |
| /* Responsive SVGs | |
| Svgs don't like their ratio in safari. So we remove the browsers ability to | |
| use it's own free will. Then we make the fucking thing work responsively. Neat! */ | |
| object.svg { | |
| width: 100%; |
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
| sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql; | |
| sudo ln -s /Applications/MAMP/Library/bin/mysqlcheck /usr/local/bin/mysqlcheck; | |
| sudo ln -s /Applications/MAMP/Library/bin/mysqldump /usr/local/bin/mysqldump |
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
| jQuery(document).ready(function($){ | |
| $('.area').on('hover', function(){ | |
| $('.area').addClass('unwanted'); | |
| $(this).addClass('pick-me'); | |
| $(this).removeClass('unwanted'); | |
| }); | |
| $('.area').on('mouseleave', function(){ | |
| $('.area').removeClass('unwanted'); | |
| $('.area').removeClass('pick-me'); |
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
| irb | |
| require 'watir-webdriver' | |
| b = Watir::Browser.new | |
| b.goto 'http://demo.woothemes.com/canvas/shop/woo-single-1/' | |
| b.button(:class => 'single_add_to_cart_button').click | |
| b.goto 'http://demo.woothemes.com/canvas/checkout/' | |
| b.text_field(:id => 'billing_first_name').set 'Andrew' | |
| b.text_field(:id => 'billing_last_name').set 'Lazarus' | |
| b.text_field(:id => 'billing_address_1').set '51 Sneinton Dale' | |
| b.text_field(:id => 'billing_city').set 'Nottingham' |
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
| sudo apt-get install motion | |
| sudo apt-get install ffmpeg | |
| nano /etc/motion/motion.conf | |
| #turnoff camera | |
| webcam_localhost off | |
| control_localhost off | |
| width 640 | |
| height 640 |
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
| // Inline block sorted out with javascript. Plain vanilla javascript. | |
| // Technially, this removes unwanted nodes from inside a DOM node | |
| var utils = {}; | |
| utils.clean = function(node) { | |
| var child, i, len = node.childNodes.length; | |
| if (len === 0) { return; } | |
| // iterate backwards, as we are removing unwanted nodes | |
| for (i = len; i > 0; i -= 1) { | |
| child = node.childNodes[i - 1]; |
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
| /* Not so small grid. | |
| How this grid works. | |
| To start, give every grid item a class of `c` | |
| */ | |
| /*! END OF THE FUCKING GRID */ |
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 | |
| // As of WP 3.1.1 addition of classes for css styling to parents of custom post types doesn't exist. | |
| // We want the correct classes added to the correct custom post type parent in the wp-nav-menu for css styling and highlighting, so we're modifying each individually... | |
| // The id of each link is required for each one you want to modify | |
| // Place this in your WordPress functions.php file | |
| function remove_parent_classes($class) { | |
| // check for current page classes, return false if they exist. | |
| return ($class == 'current_page_item' || $class == 'current_page_parent' || $class == 'current_page_ancestor' || $class == 'current-menu-item') ? FALSE : TRUE; | |
| } |