Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Vladimir L vladimir-light

🎯
Focusing
View GitHub Profile
View gitconfig
[core]
autocrlf = input
whitespace = cr-at-eol
[alias]
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
co = checkout
ci = commit
st = status
br = branch
bra = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
@vladimir-light
vladimir-light / index.php
Created Jun 15, 2020
AdminerPHP -> index.php with version and plugins (themes)
View index.php
<?php
/**
* For https://github.com/pematon/adminer-theme
*
* root
* ├───css
* ├───fonts
* ├───images
* ├───lib
* └───plugins
View xdebug.ini
[xdebug]
zend_extension ="C:/wamp64/bin/php/php7.1.12/zend_ext/php_xdebug-2.5.5-7.1-vc14-x86_64.dll"
xdebug.remote_enable = 1
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="c:/wamp64/tmp"
xdebug.show_local_vars=0
@vladimir-light
vladimir-light / get_all_constraints_from_current_db.sql
Last active Aug 29, 2015
Find / Check All Foreign Keys of a DataBase
View get_all_constraints_from_current_db.sql
SELECT
constraint_name,
table_name
FROM
information_schema.table_constraints
WHERE
constraint_type = 'FOREIGN KEY'
AND table_schema = DATABASE()
ORDER BY
constraint_name;
@vladimir-light
vladimir-light / langfiles2database.php
Last active Nov 8, 2018
FuelPHP lang-files to DB task (dirty)
View langfiles2database.php
<?php
/*
* @author Vladimir Leitenberger (vLight)
*/
namespace Fuel\Tasks;
class Langfiles2database
{
View sakila_customer_payments.sql
SELECT p.customer_id,
i.inventory_id,
f.title,
f.rental_duration,
f.rental_rate,
r.rental_id,
r.rental_date,
r.return_date,
p.payment_id,
p.amount,
@vladimir-light
vladimir-light / sakila_paiment_amount.sql
Last active Jan 3, 2016
Sakila re-calculating paiment amount (by days and hours)
View sakila_paiment_amount.sql
SELECT i.inventory_id,
f.title,
@rental_duration_in_days := f.rental_duration as 'rental_duration_in_DAYS',
@rental_duration_in_hours := (@rental_duration_in_days * 24) as 'rental_duration_in_HOURS',
f.rental_rate,
p.amount as 'amount_paid',
r.rental_date,
r.return_date,
@total_days_rented := DATEDIFF(r.return_date, r.rental_date) AS 'total_DAYS_rented',
@rental_ratio_days := CAST((@total_days_rented / @rental_duration_in_days) AS DECIMAL(11,4)) AS 'rental_ratio_by_DAYS',
@vladimir-light
vladimir-light / onlyForAjax.php
Last active Dec 11, 2015
Checks if request is a AJAX-Request
View onlyForAjax.php
<?php
$ajax = false;
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest')
{
$ajax = true;
}
if (!$ajax)
View dabblet.html
<nav>
<ul>
<li><a href="#">home</a></li>
<li><a href="#">portfolio</a></li>
<li><a href="#">images</a></li>
<li><a href="#">contact</a></li>
<li><a href="#">map</a></li>
</ul>
</nav><!-- content to be placed inside <body>…</body> -->
@vladimir-light
vladimir-light / count_all_tables_in_db.sql
Created Jul 13, 2012
Count all tables in a specific SCHEMA - MySQL
View count_all_tables_in_db.sql
--
-- Only TABLES
--
SELECT COUNT(*) AS `all_tables`
FROM information_schema.`TABLES`
WHERE table_schema = '<schema_name>'
AND table_type = 'BASE TABLE'
--
-- EVERYTHING: TABLES, VIEWS, ETC
You can’t perform that action at this time.