A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| // Example: Set your color variables | |
| $color--gray: #888888; | |
| $color--blue: #3366FF; | |
| $color--teal: #43E7F9; | |
| $color--green: #5BD642; | |
| $color--orange: #ffae18; | |
| $color--red: #FF4732; | |
| // Example: Set a color shade step interval |
| docker run --name mysql \ | |
| -p 3306:3306 \ | |
| -e MYSQL_ROOT_PASSWORD=my-password \ | |
| -e MYSQL_DATABASE=some-db-name \ | |
| -e MYSQL_USER=some-user \ | |
| -e MYSQL_PASSWORD=some-user-password \ | |
| -d mysql:5.7 | |
| docker stop mysql | |
| docker rm mysql |
| <?php | |
| //Add defer to all Javascripts | |
| if (!(is_admin() )) { | |
| function defer_parsing_of_js ( $url ) { | |
| if ( FALSE === strpos( $url, '.js' ) ) return $url; | |
| if ( strpos( $url, 'jquery.js' ) ) return $url; | |
| // return "$url' defer "; | |
| return "$url' defer onload='"; | |
| } | |
| add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 ); |
| ... | |
| ... | |
| providers: [ | |
| { provide: Http, useClass: ExtendedHttpService } | |
| ] | |
| ... | |
| ... |
| /** | |
| * HEX Color sanitization callback. | |
| * | |
| * - Sanitization: hex_color | |
| * - Control: text, WP_Customize_Color_Control | |
| * | |
| * Note: sanitize_hex_color_no_hash() can also be used here, depending on whether | |
| * or not the hash prefix should be stored/retrieved with the hex color value. | |
| * | |
| * @see sanitize_hex_color() https://developer.wordpress.org/reference/functions/sanitize_hex_color/ |
| /*! | |
| * ionic.bundle.js is a concatenation of: | |
| * ionic.js, angular.js, angular-animate.js, | |
| * angular-sanitize.js, angular-ui-router.js, | |
| * and ionic-angular.js | |
| */ | |
| /*! | |
| * Copyright 2014 Drifty Co. | |
| * http://drifty.com/ |
| /** | |
| * Theme Options Customizer Implementation. | |
| * | |
| * @link http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/ | |
| * | |
| * @param WP_Customize_Manager $wp_customize Object that holds the customizer data. | |
| */ | |
| function sk_register_theme_customizer( $wp_customize ){ | |
| /* |
| import sys, cv2 | |
| # Refactored https://realpython.com/blog/python/face-recognition-with-python/ | |
| def cascade_detect(cascade, image): | |
| gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | |
| return cascade.detectMultiScale( | |
| gray_image, | |
| scaleFactor = 1.15, | |
| minNeighbors = 5, |
| App::register('MyApp\Providers\MyServiceProvider'); |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)