Skip to content

Instantly share code, notes, and snippets.

View r8or0pz's full-sized avatar
🏠
Working from home

Roman Borysenko r8or0pz

🏠
Working from home
View GitHub Profile
@r8or0pz
r8or0pz / git-move.sh
Last active August 29, 2015 14:06
Moving directories over Git repositories keeping commits history
# clone sorce repo
git clone git://example.com/${sorce_repo}.git && cd ${sorce_repo}
# delete remote
git remote rm origin
# remove all unnecessary files and directories
git rm -r ...
# if you need to move directories just move them now
#!/bin/bash
search="$1"
replace="$2"
target_dir="$3"
[ -n "$search" ] || \
{ echo "search is empty"; exit 1; }
[ -n "$replace" ] || \
{ echo "replace is empty"; exit 1; }
@r8or0pz
r8or0pz / gist:a5df1fab454ebe9ef8bc
Created April 21, 2015 07:43
oracle connection string
sqlplus64 user/pass@//host/db
Ctrl + a – go to the start of the command line
Ctrl + e – go to the end of the command line
Ctrl + k – delete from cursor to the end of the command line
Ctrl + u – delete from cursor to the start of the command line
Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
Ctrl + xx – move between start of command line and current cursor position (and back again)
Alt + b – move backward one word (or go to start of word the cursor is currently on)
Alt + f – move forward one word (or go to end of word the cursor is currently on)
Alt + d – delete to end of word starting at cursor (whole word if cursor is at the beginning of word)
{
"phpcs_php_path": "/usr/bin/php",
"phpcs_executable_path": "/usr/bin/phpcs",
"phpmd_executable_path": "/usr/bin/phpmd",
"php_cs_fixer_executable_path": "/usr/local/bin/php-cs-fixer",
"php_cs_fixer_on_save": true
}
RewriteEngine On
RewriteRule ^/servicestatus$ /servicestatus.php [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteCond %{THE_REQUEST} ^GET\ /elb-health-check [NC]
RewriteRule ^ - [R=200]
RewriteCond %{THE_REQUEST} ^GET\ /route53-health-check [NC]
RewriteRule ^ - [R=200]
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container-name
<?php
namespace Controller;
use Symfony\Component\HttpFoundation\Request;
class FooController
{
public function doSomething(Request $request, AwesomeService $service)
{
@r8or0pz
r8or0pz / test1.php
Last active December 25, 2018 12:11
<?php
public function createCollection(QueryBuilder $qb, array $args, Callable $createLinkFunc)
{
// ...
$pager = new Pagerfanta(new DoctrineORMAdapter($qb));
}