Skip to content

Instantly share code, notes, and snippets.

View assertchris's full-sized avatar
💭
I may be slow to respond.

Christopher Pitt assertchris

💭
I may be slow to respond.
View GitHub Profile
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@JustSteveKing
JustSteveKing / State.php
Created August 11, 2023 18:31
US States as a PHP Enum
<?php
declare(strict_types=1);
namespace App\Enums;
enum State: string
{
case ALABAMA = 'AL';
case ALASKA = 'AK';
@eridal
eridal / Compiler.java
Last active August 9, 2023 13:26
Java to PHP Compilation
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;
@cheeaun
cheeaun / putonglasses.txt
Created September 14, 2012 08:57
put on glasses unicode
•_•)
( •_•)>⌐■-■
(⌐■_■)
@DanielWright
DanielWright / README.md
Created November 16, 2011 18:51
Simple font-smoothing in Internet Explorer

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.

@codeguy
codeguy / geocode-address.js
Created September 24, 2013 18:37
Geocode address with Google Maps API
/**
* 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
@wayneashleyberry
wayneashleyberry / latlng.php
Created November 26, 2012 11:20
maps api latlng
<?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";
@wayneashleyberry
wayneashleyberry / gist:3893207
Created October 15, 2012 15:49
fuzzy string matching in javascript
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;