Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php print_r(hex2RGB('00ff67')); ?> | |
| #Out | |
| Array | |
| ( | |
| [red] => 0 | |
| [green] => 255 | |
| [blue] => 103 | |
| ) | |
| <?php echo hex2RGB('#00ff67',true ); ?> | |
| __#Out__ |
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/hex" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "log" | |
| "net" |
| <?php | |
| //absolute path to wp-load.php, or relative to this script | |
| //e.g., ../wp-core/wp-load.php | |
| include( 'trunk/wp-load.php' ); | |
| //grab the WPDB database object, using WP's database | |
| //more info: http://codex.wordpress.org/Class_Reference/wpdb | |
| global $wpdb; |
| <?php | |
| function my_is_valid_domain( $url ) { | |
| $whitelisted_domains = array( 'mydomain.com', 'mydomain.net' ); | |
| $domain = parse_url( $url, PHP_URL_HOST ); | |
| // Check if we match the domain exactly | |
| if ( in_array( $domain, $whitelisted_domains ) ) | |
| return true; | |
| $valid = false; |
| license: gpl-3.0 |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| package org.first.team342.smartdashboard.camera; | |
| import edu.wpi.first.smartdashboard.gui.DashboardFrame; | |
| import edu.wpi.first.smartdashboard.gui.DashboardPrefs; | |
| import edu.wpi.first.smartdashboard.gui.StaticWidget; | |
| import edu.wpi.first.smartdashboard.properties.IPAddressProperty; | |
| import edu.wpi.first.smartdashboard.properties.Property; | |
| import java.awt.Color; | |
| import java.awt.Dimension; | |
| import java.awt.Graphics; |
| // ----------------------------------------------------------------------- | |
| // Eros Fratini - [email protected] | |
| // jqprint 0.3 | |
| // | |
| // - 19/06/2009 - some new implementations, added Opera support | |
| // - 11/05/2009 - first sketch | |
| // | |
| // Printing plug-in for jQuery, evolution of jPrintArea: http://plugins.jquery.com/project/jPrintArea | |
| // requires jQuery 1.3.x | |
| // |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin