Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Vladimir Leitenberger vlad-light

🎯
Focusing
Block or report user

Report or block vlad-light

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
@vlad-light
vlad-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;
@vlad-light
vlad-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,
@vlad-light
vlad-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',
@vlad-light
vlad-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> -->
@vlad-light
vlad-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.