Skip to content

Instantly share code, notes, and snippets.

View Slaver's full-sized avatar

Viacheslav Radionov Slaver

View GitHub Profile
@stvar
stvar / youtube-search.py
Last active June 20, 2023 14:23
Find YouTube channel IDs by custom URLs or user names
#!/usr/bin/python3
# Copyright (C) 2020 Stefan Vargyas
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@NaveenKharwar
NaveenKharwar / docker-compose.yml
Last active November 10, 2022 15:56
Docker Compose File:- WordPress + PhpMyAdmin + WP-CLI
version: '3'
services:
# Database
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@joseluisq
joseluisq / mysql_query_log.md
Last active May 24, 2024 07:31
How to enable the MySQL/MariaDB general query logs

How to enable the MySQL/MariaDB general query logs

  1. Enter to MySQL/MariaDB server command-line tool (change root with your username and password):
mysql -u root -proot
  1. Set the general log file path:
SET GLOBAL general_log_file='/var/log/mysql/mycustom.log';
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.1
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2
@gavinbenda
gavinbenda / twitter-rss.php
Last active December 18, 2015 10:49
Adaptor for apps requiring Twitter feeds in RSS format. You'll also need to download the TwitterAPIExchange.php class from here: https://github.com/J7mbo/twitter-api-php/blob/master/TwitterAPIExchange.php Follow these instructions to setup your Twitter app: http://stackoverflow.com/questions/12916539/simplest-php-example-retrieving-user-timeline…
<?php
/*
/* enter your Twitter username here */
DEFINE('TWITTER_USERNAME', 'replace-me');
/*
/* this is where you put in all of your secret spices */
/* check out this guide for an explaination: http://stackoverflow.com/questions/12916539/simplest-php-example-retrieving-user-timeline-with-twitter-api-version-1-1/15314662#15314662 */
@faisalman
faisalman / analytics-regexp.js
Created April 18, 2011 08:06
Regular Expression snippets to validate Google Analytics tracking code (in PHP, JavaScript)
/**
* Regular Expression snippets to validate Google Analytics tracking code
* see http://code.google.com/apis/analytics/docs/concepts/gaConceptsAccounts.html#webProperty
*
* @author Faisalman <movedpixel@gmail.com>
* @license http://www.opensource.org/licenses/mit-license.php
* @link http://gist.github.com/faisalman
* @param str string to be validated
* @return Boolean
*/