Skip to content

Instantly share code, notes, and snippets.

.leaflet-div-icon {
background: transparent;
border: none;
}
.leaflet-marker-icon .number{
position: relative;
top: -37px;
font-size: 12px;
width: 25px;
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
var invokee1 = function(err, callback) {
// cant change this function
callback();
};
var invokee2 = function(err, optional1, optional2, callback) {
// work with optional 1 or optional 2
console.log(optional1);
console.log(optional2);
// cant change this function

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

<?php
/**
* The __halt_compiler() function will stop the PHP compiler when called.
* You can then use the __COMPILER_HALT_OFFSET__ constant to grab the contents of the PHP file after the halt.
* In this example a PHP template is stored after the halt, to allow simple separation of logic from templating.
* The template is stored in a temporary file so it can be included and parsed.
*
* See: https://github.com/bobthecow/mustache.php/blob/dev/src/Mustache/Loader/InlineLoader.php
* http://php.net/manual/en/function.halt-compiler.php
*/
-- Update record revision numbers for a region, so they display in Perch.
-- Replace :regionID and :revisionNum
UPDATE perch2_content_items pci
INNER JOIN
(
SELECT
itemID,
MAX(itemRev) AS itemRevMax
FROM perch2_content_items
<?php
/**
* Composite Slug Field Type.
*
* File: PERCH_PATH/addons/fieldtypes/compslug/compslug.class.php
* Usage: <perch:content id="slug" type="compslug" for="lastname firstname" suppress="true" />
* @author Jamie York
**/
class PerchFieldType_compslug extends PerchFieldType
{
<?php
class Post
{
protected $table = 'posts';
/**
* You can define your own custom boot method.
*
* @return void
**/
$.fn.extend({
// ---- HTML Comments ---- //
comments: function() {
return $(this).contents()
.filter(function() {
return this.nodeType == 8;
});
},
// ---- Outer HTML ---- //