./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name| const int redPin = 11; | |
| const int greenPin = 10; | |
| const int bluePin = 9; | |
| void setup() { | |
| // Start off with the LED off. | |
| setColourRgb(0,0,0); | |
| } | |
| void loop() { |
| // Support Classes | |
| class Vec3f { | |
| float x, y, z; | |
| Vec3f(float x, float y, float z) { | |
| this.x = x; | |
| this.y = y; | |
| this.z = z; | |
| } | |
| void scale(float scale) { | |
| this.x *= scale; |
| <?php | |
| /** | |
| * gets the current post type in the WordPress Admin | |
| */ | |
| function get_current_post_type() { | |
| global $post, $typenow, $current_screen; | |
| //we have a post so we can just get the post type from that | |
| if ( $post && $post->post_type ) | |
| return $post->post_type; |
| <?php | |
| //* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
| /** | |
| * Manage WooCommerce styles and scripts. | |
| */ | |
| function grd_woocommerce_script_cleaner() { | |
| // Remove the generator tag | |
| remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
| <?php | |
| /* | |
| replacing the default "Enter title here" placeholder text in the title input box | |
| with something more descriptive can be helpful for custom post types | |
| place this code in your theme's functions.php or relevant file | |
| source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963 | |
| */ |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
| add_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
| add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
| function my_show_extra_profile_fields( $user ) { ?> | |
| <h3>Extra profile information</h3> | |
| <table class="form-table"> |
| #Make a new branch: | |
| gco -b new_branch | |
| #do bunch of changes | |
| ga -A | |
| gc -m "Made a bunch of changes" | |
| #checkout master | |
| gco master | |
| #get the latest updates to master | |
| gl | |
| #Go back to new_branch or whatever you called it |
| function wpdl(){ | |
| if [[ -d ./${1} ]]; then | |
| echo "Project directory exists, exiting..." | |
| elif [[ $# = 1 ]]; then | |
| mkdir $1 | |
| cd $1 | |
| curl -O http://wordpress.org/latest.zip | |
| unzip latest.zip | |
| rm latest.zip | |
| mv wordpress/* ./ |