A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer
- Composer Related
- Frameworks
- Micro Frameworks
| /* | |
| Makefile: | |
| (make sure Makefile is indented using a tab and not spaces) | |
| all: | |
| cc -Wall -g -O0 rdb_mergeop.c -o rdb_mergeop -lstdc++ -lrocksdb -lsnappy -lbz2 -llz4 -lz | |
| clean: | |
| rm -rf rdb_mergeop | |
| rm -rf testdb | |
| */ |
| <script> | |
| jQuery.ajax({ | |
| type: 'GET', | |
| url: 'http://mysite.myshopify.com/cart.json', | |
| dataType: 'jsonp', | |
| success: function(data) { | |
| var item_count = data['item_count']; | |
| var total_price = data['total_price']/100; | |
| //If there are items in cart |
| /* add new tab called "mytab" */ | |
| add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 ); | |
| function my_custom_tab_in_um( $tabs ) { | |
| $tabs[800]['mytab']['icon'] = 'um-faicon-pencil'; | |
| $tabs[800]['mytab']['title'] = 'My Custom Tab'; | |
| $tabs[800]['mytab']['custom'] = true; | |
| return $tabs; | |
| } | |
| function getImageBrightness(imageSrc, callback) { | |
| var img = document.createElement('img'), | |
| colorSum = 0, | |
| i = 0, | |
| len, | |
| canvas, | |
| ctx, | |
| imageData, | |
| data, | |
| brightness, |
| /** | |
| * Register Custom myCRED Hook | |
| * @since 1.0 | |
| * @version 1.0 | |
| */ | |
| add_filter( 'mycred_setup_hooks', 'Learndash_myCRED_Hook' ); | |
| function Learndash_myCRED_Hook( $installed ) { | |
| $installed['hook_learndash'] = array( | |
| 'title' => __( 'LearnDash', 'mycred' ), |
| <?php | |
| /** | |
| * Remove the preview step. Code goes in theme functions.php or custom plugin. | |
| * @param array $steps | |
| * @return array | |
| */ | |
| function custom_submit_job_steps( $steps ) { | |
| unset( $steps['preview'] ); | |
| return $steps; |
| /* Smooth Back to Top, Get This functionality from: http://wordpress.org/extend/plugins/cudazi-scroll-to-top/ */ | |
| jQuery.noConflict(); | |
| jQuery(function($) { | |
| // When to show the scroll link | |
| // higher number = scroll link appears further down the page | |
| var upperLimit = 100; | |
| // Our scroll link element |
| /** | |
| * Utility function to check if a gravatar exists for a given email or id | |
| * @param int|string|object $id_or_email A user ID, email address, or comment object | |
| * @return bool if the gravatar exists or not | |
| */ | |
| function validate_gravatar($id_or_email) { | |
| //id or email code borrowed from wp-includes/pluggable.php | |
| $email = ''; |