This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
fatal() { echo "FATAL: $@" 1>&2; exit 1; } | |
warn() { echo "WARN: $@"; } | |
info() { echo "INFO: $@"; } | |
usage() { | |
cat <<EOF | |
Usage: sudo $0 client_or_profile_name | |
This will create two ovpn files in this directory (proxy and noproxy). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('vc_shortcodes_css_class', function ($class_string, $tag) { | |
$tags_to_clean = [ | |
'vc_row', | |
'vc_column', | |
'vc_row_inner', | |
'vc_column_inner' | |
]; | |
if (in_array($tag, $tags_to_clean)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CHANGE THESE | |
auth_email="user@example.com" | |
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings | |
zone_name="$1" | |
record_name="$2" | |
# MAYBE CHANGE THESE | |
ip=$(curl -s http://ipv4.icanhazip.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dg_get_data() { | |
return array( | |
'name' => 'Darko Gjorgjijoski', | |
'age' => 23 | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install libc6:i386 libstdc++6:i386 | |
wget http://cdn.primatelabs.com/Geekbench-3.4.2-Linux.tar.gz | |
tar -zxvf Geekbench-3.4.2-Linux.tar.gz | |
cd dist/Geekbench-3.4.2-Linux/ | |
./geekbench |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automatically instal the latest nginx | |
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
#Make a backup copy of your current sources.list file | |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
#Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class DG_Image_Import | |
* @author Darko Gjorgjijoski <dg@darkog.com> | |
* @license GPLv2 | |
* @copyright 2019 | |
* | |
* Handles import of images from a specific subfolder of your root site dir (eg public_html/your_data_dir) to WordPress media library. | |
* Has basic lock/unlock functionality to avoid colisions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if there is still pending registration for specific username | |
* @param $username | |
* | |
* @return bool | |
*/ | |
function dg_check_pending_registration($username) { | |
global $wpdb; | |
$table = $wpdb->prefix . 'signups'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This file contains general useful PHP functions that can be included everywhere. | |
/** | |
* Wrapper for writing the interactions to /wp-content/uploads/ file | |
* | |
* @param $message | |
* @param string $filename | |
*/ | |
function dg_log_write( $message, $filename = "log.txt" ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="POST"> | |
<div class="form-row"> | |
<label>Name</label> | |
<input type="text" placeholder="Enter name"> | |
<div> | |
<div class="form-row"> | |
<?php | |
$key = 'profile_picture'; | |
$placeholder = 'https://placehold.it/150x150?text=IMG'; | |
$current_value = get_user_meta(get_current_user_id(), $key, true); |