Skip to content

Instantly share code, notes, and snippets.

View el22or's full-sized avatar

Dragan Eror el22or

View GitHub Profile
@el22or
el22or / Drupal files path.sql
Created July 9, 2011 00:13
Update Drupal files path in database manually
UPDATE files SET filepath = REPLACE (filepath, 'old/path', 'new/path');
@el22or
el22or / regex-color
Created October 17, 2012 02:49
Regex for hex color
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
@el22or
el22or / mysql-export-import
Last active September 28, 2022 12:04
Remote MySQL database dump directly into local database
## SSH - Remote export > local import
ssh USER@HOST mysqldump -uREMOTEDATABASEUSER -pREMOTEDATABASEPASSWORD -hREMOTEHOST REMOTEDATABASENAME | mysql -uLOCALDATABASEUSER -pLOCALDATABASEPASSWORD LOCALDATABASENAME
## Export to CSV
mysql -uUSER -pPASS DATABASENAME -B -e "select * from \`korisnici\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv
## Export to CSV 2
mysql -uUSER -pPASS DATABASE -B -e "SELECT users.uid AS 'ID', users.name AS 'Username', users.mail AS 'Email', from_unixtime(users.created) AS 'Created', from_unixtime(users.login) AS 'Last login' FROM users WHERE users.status=1 AND users.login!=0 ORDER BY users.login DESC;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > vehicle_categories.csv
## Export to SQL gzipped file with compression
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA9k/2nrH/FwFhclJJ0xgzaQr9H0KaxVW5kHgWEyhYCSDcflLVTU4D4Qfo5SPB2cGmcAw+c4MluEzH7Udj7KuWyKdIOKMj+tv8Arr0ufgV3NwsxassTeeTWzgPu635xz7j46JC0wXLG4nA1nzPZIKSKvPulCnwskkzo0lwaE3dHmA4t3yEL6fqn/sOZdjpUT1BSK0cASv+R74A38wS9IJNvC4EJiqruaaF6jgKDVUuyoX5aKeeDYC5FAQOBvMuPBgD6TJa4+CvMQlwS8Qqcy9cgTlx7TOcMlUrLz4OLMh8riYJm+JuK8nNAkRPrxX+LJVBz4XOyV3MasVx5aI9cLENEQ== [email protected]
# CSS
* Never use unit when value of measuring is 0. (0px, 0em, 0pt)
@el22or
el22or / settings.local.php
Created April 1, 2015 08:19
Drupal local settings
<?php
/**
* @file
* Drupal development-specific configuration file.
*/
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'DBNAME',
// Font faces.
// - Here define your custom font-faces.
// Clarendon - regular.
@include font-face(
"clarendon",
font-files(
"clarendon_text_pro-webfont.ttf",
"clarendon_text_pro-webfont.eot",
"clarendon_text_pro-webfont.woff",
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $head_scripts; ?>
</head>
<body<?php print $body_attributes;?>>

Git notes

Remotes

Working with remotes

  • Show remotes
git remote
git remote show upstream
$breakpoints: (
small: 0, // Phones, watches, ...
narrow: 640px, // Portrait oriented tablets
normal: 980px, // Landscape oriented tablets, laptops, smaller desktop screens, ...
wide: 1200px // Large desktop screens, TVs, ...
);
@function breakpoint-size($key, $max-width: false) {
@if ($max-width) {
@return map-get($breakpoints, $key) - 1
}