Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# configure here:
# first top left (north west)
my $startlon = 13.40991;
my $startlat = 52.48905;
# then bottom right (south east)
my $endlon = 13.42209;
my $endlat = 52.47982;
#zoom level:
@romansklenar
romansklenar / Blob.php
Created August 15, 2010 03:36
Doctrine 2, BLOB datatype implementation
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@beberlei
beberlei / Document.php
Created May 18, 2011 10:46
My Symfony2 File Upload workflow
<?php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @Entity
*/
class Document
{
@karmi
karmi / elastic_search_ngram_analyzer_for_urls.sh
Created May 24, 2011 15:32
NGram Analyzer in ElasticSearch
# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/ngram_test
curl -X PUT localhost:9200/ngram_test -d '
{
"settings" : {
"index" : {
"analysis" : {
@gigo6000
gigo6000 / SendEmailCommand.php
Created June 29, 2011 03:03
Symfony2 console/command-line command to send email
namespace VayaFeliz\SiteBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class SendEmailCommand extends Command
@gigo6000
gigo6000 / staging.rb
Created June 29, 2011 03:18
Capifony task to send the email
namespace :deploy do
desc "Send notification email"
task :sendemail do
run("cd #{deploy_to}/current && php app/console deploy:sendemail [email protected] [email protected] \"Deploy Complete.\" ")
end
end
after 'deploy:restart', 'deploy:sendemail'
@mablae
mablae / noise.sh
Created October 10, 2011 13:34 — forked from rsvp/noise.sh
noise : relaxing ambient Brown noise generator (cf. white noise) | Linux bash script using sox | CogSci notes
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-04
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)
@jakzal
jakzal / KernelAwareTest.php
Last active June 27, 2024 16:20
KernelAwareTest
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{
@nocksock
nocksock / deploy.rb
Created December 7, 2011 16:06
Capistrano Drupal(6) Deployment Recipe
#
# Capistrano recipe for deploying Drupal7 using git and ssh.
#
# Part of the explanations in the comments taken from:
# http://help.github.com/deploy-with-capistrano/
#
set :default_environment, {
# This is the $PATH for the deploymant shell. using uberpsace's recent php
# and added ~/bin for drush.
@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.