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.
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 | |
declare(strict_types=1); | |
namespace App\Enums; | |
enum State: string | |
{ | |
case ALABAMA = 'AL'; | |
case ALASKA = 'AK'; |
package j2p; | |
import japa.parser.JavaParser; | |
import japa.parser.ParseException; | |
import japa.parser.ast.CompilationUnit; | |
import japa.parser.ast.ImportDeclaration; | |
import japa.parser.ast.PackageDeclaration; | |
import japa.parser.ast.body.BodyDeclaration; | |
import japa.parser.ast.body.ClassOrInterfaceDeclaration; | |
import japa.parser.ast.body.FieldDeclaration; |
•_•) | |
( •_•)>⌐■-■ | |
(⌐■_■) |
The filter
and zoom
rules in the sample stylesheet above will apply a smoothing/blurring effect to text elements. In the sample stylesheet, these rules are applied to all headers, paragraphs, list items, and table cells, but in practice, you will want to tailor the application of the smoothing effect to only those elements rendering with significant aliasing.
Nota Bene: the filter appears to place an overflow: hidden
-style block around the elements being smoothed, so do not apply these rules directly to elements that need to scroll, or which contain absolutely positioned elements that appear outside the boundaries of the element itself.
/** | |
* Geocode address | |
* | |
* REQUIREMENTS | |
* - Google Maps API | |
* - HTML5 Geolocation API | |
*/ | |
var geocode = function (address, onSuccess, onError) { | |
var geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({ address: address }, function (results, status) { |
/** | |
* Utility class for dealing with SVG elements | |
* Copyright Virtuosi Media, Inc. 2012 | |
* MIT License | |
*/ | |
var SVG = new Class({ | |
/** | |
* @param string - el - The type of SVG element | |
* @param object - options - The attributes and values for the SVG element, stored in a hash |
<?php | |
function get_latlng ($address) | |
{ | |
// api key | |
$key = ''; | |
// maps geocode api request | |
$url = "https://maps.googleapis.com/maps/api/geocode/json"; | |
$query = "?address=" . urlencode($address) . "&sensor=false"; |
var people = ['Daniel', 'Dustin', 'David', 'Damarcus', 'Russ']; | |
function matchPeople(input) { | |
var regex = new RegExp('[' + input.split('').join(']+.*[') + ']+', 'ig'); | |
return people.filter(function(person) { | |
if (person.match(regex)) return person; | |
}); | |
} | |
console.log(matchPeople('dvd')); // returns ['David'] |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body | |
{ | |
margin: 0; | |
padding: 0; | |
background: #fff; |