Skip to content

Instantly share code, notes, and snippets.

@damour
damour / gist:e8a7fc51085da691912d85f5fde157f0
Created October 27, 2023 10:07
Golang introduction resources
https://tour.golang.org/welcome/1
http://devs.cloudimmunity.com/gotchas-and-common-mistakes-in-go-golang/
https://golang.org/doc/effective_go
https://blog.golang.org/io2013-talk-concurrency
https://github.com/golang/go/wiki/CodeReviewComments
https://golang.org/doc/code
@damour
damour / TestIterateCommand.php
Created December 20, 2015 21:32
doctrine custom hydrator
<?php
namespace Lvlp\MapcontBundle\Command;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Internal\Hydration\ArrayHydrator;
use Doctrine\ORM\Query;
use Doctrine\ORM\Query\Parser;
use Lvlp\MapcontBundle\Repository\PresetRepository;
use Symfony\Component\Console\Command\Command;
@damour
damour / convert.sh
Created January 10, 2014 13:21 — forked from akost/convert.sh
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
$._data(document, "events")
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
# Modified by Mikko Rantalainen 2012-08-09
# Pipe the output to "sort -nk3" to get sorted output
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d -regex "^/proc/[0-9]+"`
do
PID=`echo $DIR | cut -d / -f 3`
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) — %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
array(
'select' => array(
"COALESCE(
{$this->translationClass}1.name,
{$this->translationClass}3.name,
{$this->translationClass}2.name
) AS name",
"COALESCE(
{$this->translationClass}1.description,
{$this->translationClass}3.description,
Dmitriy_Garanzha
MainQuery -> minimunmatch = 2
LuceneComponent -> disable escaping "iphone"
{!df=manufacturer_s q.op=OR}\AND Apple