Skip to content

Instantly share code, notes, and snippets.

View safaeean's full-sized avatar
🧐

Hossein Piri safaeean

🧐
View GitHub Profile
@safaeean
safaeean / moshaverfarsh
Created September 8, 2021 07:31
moshaverfarsh
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5HPMNS7');</script>
<!-- End Google Tag Manager -->
<!-- Google Tag Manager (noscript) -->
@safaeean
safaeean / radiojavan.rb
Last active May 26, 2021 12:06
Fetch download links of RadioJavan Playlists #radiojavan-downloader
#!/usr/bin/env ruby
# gem install mechanize
require 'mechanize'
abort "Usage:\n\tradiojavan.rb \"https://www.radiojavan.com/playlists/playlist/mp3/02596ef9986a\" output_txt" if ARGV.size < 2
playlist_url = ARGV[0]
output_file = ARGV[1]
HOST = 'https://www.radiojavan.com'

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
@d3v2a
d3v2a / update_env.php
Created September 26, 2016 13:21
update env file with php
$key = $argv[1];
$value = $argv[2];
$path = dirname(__FILE__) . '/.env';
$newContent = '';
$content = fopen($path, 'r+');
$found = false;
while (!feof($content)) {
$line = fgets($content);
if (!empty(trim($line))) {
@paulund
paulund / example-wp-list-table.php
Last active January 28, 2025 16:01
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/