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
echo "Downloading gcc source files..." | |
curl https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2 -O | |
echo "extracting files..." | |
tar xvfj gcc-5.4.0.tar.bz2 | |
echo "Installing dependencies..." | |
yum install gmp-devel mpfr-devel libmpc-devel -y | |
echo "Configure and install..." |
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
#install lamp-stack by tasksel | |
sudo apt update && sudo apt upgrade | |
sudo apt install tasksel | |
sudo tasksel install lamp-server | |
#install phpmyadmin | |
sudo apt-get install -y phpmyadmin | |
#create db_user and grant access |
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
import json | |
import csv | |
# Opening JSON file | |
f = open('productfeed.json') | |
# returns JSON object as | |
# a dictionary | |
data = json.load(f) |
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
{%- comment -%} Metafields {%- endcomment -%} | |
{%- if product.metafields.xojson != blank -%} //change "xojson" with your scope of metafields, can be global or something else which you defined while creating them. | |
<div class="row container" id="Specifications"> | |
<header class="section__header column small-12"> | |
<h3 class="section__title heading h3">Product Attributes</h3> | |
</header> | |
<div class="row"> | |
<div class="columns medium-6 small-12 tooltip-container"> | |
<table role="presentation" style="width: 80%;background: #fff;border: solid 1px #ddd;margin-bottom: 1.25rem;table-layout: auto;"> | |
<tbody> |
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
import os | |
def getListOfFiles(dirName): | |
# create a list of file and sub directories | |
# names in the given directory | |
listOfFile = os.listdir(dirName) | |
allFiles = list() | |
# Iterate over all the entries | |
for entry in listOfFile: | |
print(entry) |
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 sitemaps() { | |
/* get all the activated languages in WPML plugin */ | |
$languages = apply_filters( 'wpml_active_languages', NULL, array( 'skip_missing' => 0)); | |
foreach((array)$languages as $lang) { | |
/* change language */ | |
do_action('wpml_switch_language', $lang['code']); | |
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 | |
/** | |
* A simple function that uses mtime to delete files older than a given age (in seconds) | |
* Very handy to rotate backup or log files, for example... | |
* | |
* $dir String whhere the files are | |
* $max_age Int in seconds | |
* return String[] the list of deleted files | |
*/ |
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
/** generate an array of random | |
* numbers within given range | |
**/ | |
function generateRandom($end, $total, $start = 0, $numbers = []) | |
{ | |
if(count($numbers) == $total) { | |
return $numbers; | |
} | |
$number = rand($start, $end); |
OlderNewer