Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View martiis's full-sized avatar

Martynas Sudintas martiis

  • Helis LT
  • Lithuania
View GitHub Profile
@ruckuus
ruckuus / PHP Redis Client Test [Predis vs phpredis]
Last active February 13, 2019 13:22
PHP Redis Client Test [Predis vs phpredis]
php redisTest.php
Keyword: free+book, score:736764
Keyword: pretty+picture, score:117600
Keyword: best+seller, score:411600
Keyword: stuff, score:2998800
Keyword: bedok, score:29400
Keyword: best+seller+free+book, score:176400
Keyword: best+seller, score:411600
Keyword: best+seller, score:411600
Keyword: free+book, score:736764
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 18, 2024 16:07
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@mnapoli
mnapoli / reference.yml
Last active January 12, 2023 00:08
Doctrine YAML configuration reference
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html
MyEntity:
type: entity
repositoryClass: MyRepositoryClass
table: my_entity
namedQueries:
all: "SELECT u FROM __CLASS__ u"
# Class-Table-Inheritance
@stevelacey
stevelacey / UrlGenerator.php
Last active October 7, 2015 21:18
Symfony2: use object to set route parameters
<?php
namespace Acme\BaseBundle\Routing\Generator;
use Symfony\Component\Routing\Generator\UrlGenerator as BaseUrlGenerator;
use Doctrine\Common\Util\Inflector;
/**
* UrlGenerator generates URL based on a set of routes.
*
@sgmurphy
sgmurphy / url_slug.php
Created July 12, 2012 15:52
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu