Skip to content

Instantly share code, notes, and snippets.

View crazyyy's full-sized avatar

Vitalii Antoniuk crazyyy

View GitHub Profile
@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 / _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 / __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 / index.html
Created January 10, 2019 20:21
#js || defer load / running javascript code
<script>
window.addEventListener('DOMContentLoaded', function() {
(function($) {
//do something with b-lazy plugin, lightbox plugin and then with flexslider
})(jQuery);
});
</script>
@crazyyy
crazyyy / _readme.md
Last active February 2, 2022 06:39
#php #wp #acf wordpress loop posts and update ACF fields

PHP favorite snippets

Enable logging

declare(strict_types=1);

ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
@crazyyy
crazyyy / another.php
Last active October 30, 2023 11:51
[💦 ACF Fake Field] ACF Fake Field Generator #php #wp #acf
<?php
// /*
function rand_float($st_num=0,$end_num=1,$mul=1000000) {
if ($st_num>$end_num) return false;
return mt_rand($st_num*$mul,$end_num*$mul)/$mul;
}
$query_args = array(
'post_type' => 'product',
'post_status' => 'publish',
@crazyyy
crazyyy / _readme.md
Last active June 26, 2021 20:21
🤸 #php Favorite Snippets

PHP Snippets

@crazyyy
crazyyy / index.js
Created December 10, 2019 17:33
#postman #js #debug
const response = JSON.parse(responseBody)
const response_length = response.length;
console.log(response_length)
console.log(response)
@crazyyy
crazyyy / _readme.md
Last active September 20, 2023 23:44
📯 #cmd #pwsh #powershell Favorit Snipps

Windows #cmd favorite snippets

add to autorun

add the full command in registry with this command as administrator*

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V VcxSrv /D "C:\apps\apps\vcxsrv\current\vcxsrv.exe :0 -multiwindow -clipboard -wgl"

# Run the server in multiwindow mode.
@crazyyy
crazyyy / gist_markdown_examples.md
Created February 22, 2020 00:14 — forked from ww9/gist_markdown_examples.md
#md || Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these: