Skip to content

Instantly share code, notes, and snippets.

View assertchris's full-sized avatar

Christopher Pitt assertchris

View GitHub Profile
// Add an outer click Event to an Element
// http://cpojer.net/blog/Custom_outerClick_event (but this page doesn't exist anymore)
Element.Events.outerClick = {
base: 'click',
condition: function(event){
event.stopPropagation();
return false;
},
@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.

@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body
{
margin: 0;
padding: 0;
background: #fff;
@cheeaun
cheeaun / putonglasses.txt
Created September 14, 2012 08:57
put on glasses unicode
•_•)
( •_•)>⌐■-■
(⌐■_■)
@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']
@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";
/**
* 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
@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) {
@padraic
padraic / survey.php
Last active August 29, 2015 13:56
Enumerating Composer packages for PHPCS analysis and data collection
<?php
define('PACKAGE_LIST', 'list.txt');
define('CODING_STANDARD', 'PSR2');
define('SEVERITY', 1);
define('ENCODING', 'utf-8');
define('REPORT', 'source');
define('EXTENSIONS', 'php');
$excluded = [
'*/test/*',