Skip to content

Instantly share code, notes, and snippets.

View ViktorAndonov's full-sized avatar
🎯
Focusing

Viktor ViktorAndonov

🎯
Focusing
View GitHub Profile
@ViktorAndonov
ViktorAndonov / system-test.js
Last active September 17, 2015 15:55
Test if to see what users uses Mac or PC (in JS)
var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
else if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
else if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
else if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
console.log('Your OS is: '+OSName);
@ViktorAndonov
ViktorAndonov / vertical-align.css
Created September 17, 2015 15:57
Vertical align anything with CSS3
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@ViktorAndonov
ViktorAndonov / git-cherry-pick.txt
Last active November 8, 2022 11:37
How to cherry pick commits
0.1) Use the terminal;
1) Make sure there is no changes in both branches (git status);
2) Checkout the brach that you want to take the commit from;
3) Use git log to show the full number of the commit that you want to cherry pick, and copy it from the teminal;
4) Now checkout the branch that you want to recive;
5) Then write: git cherry-pick [the number of the commit that you want to take, without brackets]
6) You are done! or if conflicts appear resolve them manually;
7) Then commit the changes;
@ViktorAndonov
ViktorAndonov / git-commands.md
Last active November 1, 2018 19:47
GitHub Cheat Sheet

Usefull Git commands

This document is a cheet sheet for Git & GitHub commands that i find it usefull


Git

Commands

@ViktorAndonov
ViktorAndonov / fix-developer-wp.md
Last active October 23, 2015 11:13
Fix for developer plugin error when installing the other plugins

parent::__construct( $args ); }

  • public function request_filesystem_credentials( $error = false ) {
  • public function request_filesystem_credentials( $error = false**, $context = false, $allow_relaxed_file_ownership = false** ) { return true; }

Instalaltion

npm i -g webpack this will install it globally on your system, use (sudo) if there is a problems.

Usage - small projects

You can use the npm scripts for small project to compile wabpack:

"scripts": {
    "build": "webpack src/main.js dist/bundle.js",
 "watch": "npm run build -- --watch"
@ViktorAndonov
ViktorAndonov / gulp.js for wordpress
Last active July 23, 2017 22:40
Gulp.js for WP Theme Development with SASS(SCSS)
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var sass = require('gulp-sass');
// browser-sync task for starting the server.
gulp.task('browser-sync', function() {
//watch files
var files = [
'./*.css',
@ViktorAndonov
ViktorAndonov / docker_cheatsheet.md
Last active September 12, 2019 18:31
Docker Cheat Sheet

List Docker CLI commands

docker
docker container --help

Display Docker version and info

docker --version
docker version
docker info

Execute Docker image

@ViktorAndonov
ViktorAndonov / WordPress 5.3+ 2020 .gitignore file
Created February 13, 2020 14:17
.gitignore Vagrant VVV file for WordPress 5.3+ 2020
# This file will only track custom themes
/*
!public_html/
public_html/*
!public_html/wp-content/
public_html/wp-content/*
public_html/wp-content/plugins/*
@ViktorAndonov
ViktorAndonov / .gitignore
Created April 2, 2020 12:05
.gitignore file does not work - FIX
git rm -r --cached .
git add .
git commit -m "fixed untracked files"