Skip to content

Instantly share code, notes, and snippets.

View hightemp's full-sized avatar
🎯
Focusing

Anton Panov hightemp

🎯
Focusing
View GitHub Profile
@hightemp
hightemp / parse_hash.js
Created June 30, 2020 10:02 — forked from danmartens/parse_hash.js
Parses location.hash into an Object
window.parseHash = function() {
var parsed = {};
var pairs = window.location.hash.replace('#', '').split('&');
pairs.forEach(function(pair) {
parsed[pair.split('=')[0]] = (parseInt(pair.split('=')[1], 10) || pair.split('=')[1]);
});
return parsed;
};
@hightemp
hightemp / component.vue
Last active June 30, 2020 07:54
nuxt socket.io
<template>
<div></div>
</template>
<script>
import Vue from 'vue';
export default {
props: [
],
@hightemp
hightemp / doxygen_on_centos_6.7
Created June 23, 2020 06:09 — forked from slog2/doxygen_on_centos_6.7
how to use Doxygen on CentOS 6.7
# Install
yum -y install doxygen
yum -y install graphviz
yum -y install texlive texlive-utils
# Make default config for doxygen
cd {c_source_dir}
doxygen -g my.doxy
@hightemp
hightemp / js_func_regexp_add.txt
Created June 22, 2020 08:13
Добавление комментария NOTE перед функцией в javascript
(async\s+)?(\w+)(\s*\(.*?\)\s*)(\s*\/\/.*?)?
\{
// NOTE: $2
$1$2$3$4
{
@hightemp
hightemp / git.md
Created May 25, 2020 09:58 — forked from dustinmartin/gist:2966397
Git Command Cheatsheet

Setup

git clone clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

[color]

@hightemp
hightemp / reflog.sh
Created May 25, 2020 09:30 — forked from nickolasburr/reflog.sh
reflog: Pretty format `git reflog show` with optional flag options for refining reflog output
#!/usr/bin/env bash
# reflog: Pretty format `git reflog show` with optional flag options for refining reflog output
reflog () {
if [[ ! "$(git rev-parse --is-inside-work-tree)" ]] 2>/dev/null; then
echo "fatal: Not a git repository (or any of the parent directories): .git"
return 1
fi
# decorated `git reflog show` graph format style
@hightemp
hightemp / docker_import_host.sh
Last active May 18, 2020 00:05
docker import host system
sudo su -
cd /
#tar -cpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys /
#scp user@server-uri:path_to_file/backup.tar.gz .
tar zcvf --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/srv - / | ssh $1@$2 "cat > /home/$1/frontdev.tar.gz"
echo 'cat /home/$1/frontdev.tar.gz | docker import - frontdev:v1.0'
echo 'docker run -t -i frontdev:v1.0 /bin/bash'
@hightemp
hightemp / electron_maximize.js
Last active May 17, 2020 11:01
vue electron maximize
<q-btn v-if="$q.platform.is.desktop" dense @click="fnMinimizeWindow" icon="expand_more" />
<q-btn v-if="$q.platform.is.desktop" dense @click="fnMaximizeWindow" :icon="m_bWindowIsMaximized ? 'unfold_more' : 'expand_less'" />
<q-btn v-if="$q.platform.is.desktop" dense @click="fnCloseWindow" icon="close" />
/* ... */
computed: {
bWindowIsMaximized: {
set(bValue) {
if (process.env.MODE === 'electron') {
@hightemp
hightemp / Debugger.class.php
Last active May 23, 2020 13:06
php debugger/logger
<?php
if (defined('DA_FLAG')) {
return 'defined DA_FLAG';
}
// [!] Все пути должны быть без / на конце
define('DA_ROOT_DIR', __DIR__);
define('DA_LOGS_DIR', DA_ROOT_DIR."/logs");
define('DA_FLAG_FILE', DA_LOGS_DIR."/dws_debugger.flag");
@hightemp
hightemp / httpd1
Created May 12, 2020 05:10
multi service unit file
PORT=8000
PID_FILE=/etc/httpd/run/httpd1.pid