Skip to content

Instantly share code, notes, and snippets.

View crazyyy's full-sized avatar

Vitalii Antoniuk crazyyy

View GitHub Profile
@crazyyy
crazyyy / __readme.md
Last active February 1, 2022 13:21
#regexp || examples

Regex

Find and remove vendor prefixes in your CSS using Regex

\-(moz|o|webkit|ms|khtml)\-(?!font-smoothing|osx|print|backface).+?;
@crazyyy
crazyyy / _readme.md
Last active September 20, 2023 23:07
#mysql #sql || mysql gists

Mysql

Import from commandline

mysql --host=localhost.mysql.ihc.ru --user=user_name --database=database_name --password=password > database.sql
mysql -h localhost.mysql.ihc.ru -u user_name -D database_name -p password < database.sql
mysql --host="localhost.mysql.ihc.ru" --user="user_name" --password="password" --database="database_name" < db.sql
@crazyyy
crazyyy / callback.js
Last active January 5, 2019 17:58
#js || callback functon example
/* first */
JApp.GetUserIP(function(sIP) {
oUserIp.val(sIP);
});
/* second */
that.GetUserIP = function(fnCallback) {
var sDefault = "N/A";
@crazyyy
crazyyy / footer.php
Last active January 5, 2019 18:15
#html #scss #css #js || modal window for contact form
@crazyyy
crazyyy / imacros-cheatsheet.js
Last active January 5, 2019 18:17 — forked from LeCoupa/imacros-cheatsheet.js
#imacros || iMacros CheatSheet.
// More: http://journal.gentlenode.com/imacro-1-ultimate-cheatsheet/
// iMacro CheatSheet - Command Reference
// http://wiki.imacros.net/Command_Reference
// iMacros supports 3 types of variables:
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro.
// * Built-in variables. They contain certain values set by iMacros.
// * User-defined variables. They are defined in-macro using the SET command.
@crazyyy
crazyyy / body.scss
Last active January 5, 2019 18:18
#html #scss #css #js || another modal window for contact form
body {
&.modal-opened {
overflow: hidden;
padding-right: 17px;
}
}
@crazyyy
crazyyy / new_gist_file_0
Last active January 5, 2019 18:30
#js #debug || Превращаем браузер в текстовый редактор
document.body.contentEditable=true
@crazyyy
crazyyy / header.html
Last active January 5, 2019 18:25
#js #jquery || width of screen on mobile
<meta content="user-scalable=yes, maximum-scale=1.6, width=device-width, initial-scale=1, target-densitydpi=device-dpi" name="viewport">
@crazyyy
crazyyy / asolute.url.js
Last active January 5, 2019 18:26
#js || get an absolute URL
var getAbsoluteUrl = (function() {
var a;
return function(url) {
if (!a) a = document.createElement('a');
a.href = url;
return a.href;
};
})();
@crazyyy
crazyyy / resize.js
Last active January 5, 2019 18:27
#js #jquery || get browser width and height on window resize
// get browser width and height on window resize
var headerEl = document.getElementById('header');
// when window size changed - resize first block
window.addEventListener('resize', setWindowSize);
function setWindowSize() {
if (typeof(window.innerWidth) == 'number') {
myWidth = window.innerWidth;
myHeight = window.innerHeight;
setheight(myHeight);