Skip to content

Instantly share code, notes, and snippets.

View shmidtelson's full-sized avatar
💻
I do so as much as i can

Roman Sapezhko shmidtelson

💻
I do so as much as i can
View GitHub Profile
body,
div,
dl,
dt,
dd,
ul,
li,
h1,
h2,
h3,
@shmidtelson
shmidtelson / gist:0c2afcbf365ee745f6e5c4b59d0039f2
Created October 25, 2017 09:52
Adding timezone to db (/ajax/setBreakfast.php)
<?
require( 'settings.php' );
require( 'system.php' );
$system = new System;
$system->db = $db;
$token = $system->secureField( $_POST["token"] );
$breakfast = $system->secureField( $_POST["breakfast"] );
$tzone = $system->secureField( $_POST["timezone"] );
$time = time();
{% if results.currentPage > 1 %}
<li><a href="{{ results.previousPageUrl }}"><span uk-pagination-previous></span></a></li>
{% endif %}
{% set left = results.currentPage-5 %}
{% set right = results.currentPage+5 %}
{% if left > 5 %}
{% for page in 1..2 %}
<li>
@shmidtelson
shmidtelson / default.conf
Last active November 17, 2018 10:56
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@shmidtelson
shmidtelson / sc-admin.php
Last active December 8, 2018 11:03
Fixed cyrillic shortcode names in edit function. Problem with '+' in urls
<?php
class Shortcoder_Admin{
private static $pagehook = 'settings_page_shortcoder';
public static function init(){
// Add menu
add_action( 'admin_menu', array( __class__, 'add_menu' ) );
var cheerio = require('cheerio'),
needle = require('needle'),
tress = require('tress'),
resolve = require('url'),
fs = require('fs');
var targetURL = 'https://icobench.com/icos';
var results = [];
var get_data = function (url, callback) {
needle.get(url, function (err, res) {
@shmidtelson
shmidtelson / gist:18112efbd1c10e3e76ef77b1b77c8f9d
Created April 6, 2019 11:23
Asus xonar DGX force switch FRONT and BACK output [manjaro KDE]
#! /usr/bin/python
import os
import re
import subprocess
# 0 - sub
# 1 - headphones
status =0
regex = r": values=(.+)"
<?php
$arr = [
[
'cat' = > [
'id' => 0,
'name' => 'Cat1'
],
'posts':[
[
'id': 1,
#~
let a = {
meta: {
requiresAuth: true,
userAuth: true,
adminAuth: true
}
};
axios.interceptors.response.use(
response => response,
error => {
const originalRequest = error.config;
// EXPIRED TOKEN
if (error.response.status === 401 && error.response.data.code === "token_not_valid") {
originalRequest._retry = true;
store.dispatch('AUTH_REFRESH_TOKEN', {