Skip to content

Instantly share code, notes, and snippets.

@hanicker
hanicker / palette.txt
Created September 16, 2012 10:50
OSM-bright style
/* ****************************************************************** */
/* OSM BRIGHT for Imposm */
/* ****************************************************************** */
/* For basic style customization you can simply edit the colors and
* fonts defined in this file. For more detailed / advanced
* adjustments explore the other files.
*
* GENERAL NOTES
*
@import "compass/css3/images";
// CSS-only multi-line ellipsis with generated content
// yields `position:relative`, so remember to declare an eventual `position:absolute/fixed` *after* including this mixin
@mixin limitLines(
$maxLinesPortrait, // Mandatory: The number of lines after which the clipping should take action.
$maxLinesLandscape: $maxLinesPortrait, // You may provide a different line limit for landscape orientation.
// Note that 'portrait' is our default orientation. However, if you omit $maxLinesLandscape,
// the value of $maxLinesPortrait is used for whatever orientation (that is, without a media query).
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@hanicker
hanicker / Regex
Last active August 29, 2015 14:21 — forked from boekkooi/Regex
<?php
const PATTERN_RFC3986 = '~^
(?<scheme>[a-z][a-z0-9+-\.]*)
://
(?:
(?<userinfo>
([a-z0-9\-\._\~!\$&\'()*+,;=:]|%[0-9a-f]{2})*
)@ # *( unreserved / pct-encoded / sub-delims / ":" )
)?
<?php
namespace Dpn\ToolsBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Dpn\ToolsBundle\Form\DataTransformer\EntityToIdTransformer;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\Common\Persistence\ObjectManager;
@hanicker
hanicker / RestControllerTrait.php
Created November 29, 2015 22:04 — forked from beanmoss/RestControllerTrait.php
Playing with Laravel Lumen: simple RESTful trait.
<?php namespace App\Http\Controllers;
use Illuminate\Http\Request;
trait RestControllerTrait
{
public function index()
{
$m = self::MODEL;
return $this->listResponse($m::all());
@hanicker
hanicker / removeTestDataResetEntitySeries.sql
Created March 1, 2016 22:42 — forked from peterjaap/removeTestDataResetEntitySeries.sql
Remove orders, invoices, shipments, creditmemos, customers and quotes from Magento
# Empty relevant tables
DELETE FROM sales_flat_creditmemo;
DELETE FROM sales_flat_invoice;
DELETE FROM sales_flat_order;
DELETE FROM sales_flat_quote;
DELETE FROM sales_flat_shipment;
DELETE FROM customer_entity;
# Reset increment_ids
# Beware of store_ids when using multiple stores
@hanicker
hanicker / delete-recordings.php
Created March 5, 2016 21:16 — forked from caseysoftware/delete-recordings.php
This is a simple script using the Twilio PHP Helper library to retrieve Recordings within a certain date range and then delete them.
<?php
// This assumes you have the Twilio PHP Helper library
require 'Services/Twilio.php';
// This is a file with my Account Sid and AuthToken
include 'credentials.php';
$client = new Services_Twilio($accountsid, $authtoken);
/*
@hanicker
hanicker / create-magento-user.php
Created July 11, 2016 01:53 — forked from litzinger/create-magento-user.php
Create a Magento user via PHP script to get into admin area.
<?php
define( 'USERNAME', 'new.user' );
define( 'PASSWORD', 'password' );
define( 'FIRSTNAME', 'Excited' );
define( 'LASTNAME', 'Croc' );
define( 'EMAIL', 'new.user@magento.com' );
include_once( 'app/Mage.php' );
Mage::app( 'admin' );
try {
@hanicker
hanicker / csv-to-json.php
Created December 3, 2016 23:57 — forked from robflaherty/csv-to-json.php
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed