Skip to content

Instantly share code, notes, and snippets.

View jetonr's full-sized avatar
🏠
Working from home

Jeton R. jetonr

🏠
Working from home
View GitHub Profile
var modelimport = new Ai1wm.Import();
var storage = Ai1wm.Util.random(12);
var archive_name = 'REPLACE-WITH-ARCHIVE-NAME'; // Upload backup file to wp-content > ai1wm-backups and replace filename here
var options = Ai1wm.Util.form('#ai1wm-backups-form').concat({ name: 'storage', value: storage }).concat({ name: 'archive', value: archive_name});
// Set global params
modelimport.setParams(options);
// Start import
<div class="reading-box">
<div class="title">
<a id="pollutants_link" onclick="javascript:activeReading('pollutants')" class="active">Pollutants</a></div>
<div class="pollutants" style="display:block;">
<div class="pollutant-item">
<div class="name">PM10</div>
<div class="unit">μg/m³</div>
<div class="value">87</div>
<div class="ratio-bar" style="background:#EB3737; width:calc(100%*0.83194446563721);"></div>
<div class="ratio-bar-bg"></div>
<?php
/**
* Reads the requested portion of a file and sends its contents to the client with the appropriate headers.
*
* This HTTP_RANGE compatible read file function is necessary for allowing streaming media to be skipped around in.
*
* @param string $location
* @param string $filename
* @param string $mimeType
* @return void
@jetonr
jetonr / wordcount.php
Created November 26, 2018 22:28
Word Count From Word Docs
<?php
function read_docx($filename){
$striped_content = '';
$content = '';
if(!$filename || !file_exists($filename)) return false;
$zip = zip_open($filename);
@jetonr
jetonr / coderbyte.php
Created November 26, 2018 21:24
PHP Simple Algorithms - Coderbyte.com
<?php
function NumberEncoding( $str ) {
$albphabet = range('a','z');
$arrStr = str_split( strtolower( $str ) );
$newArr = array();
foreach( $arrStr as $key => $value ) {
#!/bin/bash
# This script installs WordPress from Command Line.
#Colors settings
BLUE='\033[0;34m'
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
@jetonr
jetonr / pdf_parser.php
Last active July 29, 2016 14:02
pdf parser
<?php
include 'vendor/autoload.php';
ini_set('memory_limit','1024M');
ini_set('max_execution_time', 300);
//var_dump(pages_text('42.pdf',50,202));
var_dump(text_to_array('42.pdf.txt'));
<?php
$returnValue = json_decode(' {"countries":[["AF","Afghanistan"],["AL","Albania"],["DZ","Algeria"],["AS","American Samoa"],["AD","Andorra"],["AO","Angola"],["AI","Anguilla"],["AQ","Antarctica"],["AG","Antigua and Barbuda"],["AR","Argentina"],["AM","Armenia"],["AW","Aruba"],["AU","Australia"],["AT","Austria"],["AZ","Azerbaijan"],["BS","Bahamas"],["BH","Bahrain"],["BD","Bangladesh"],["BB","Barbados"],["BY","Belarus"],["BE","Belgium"],["BZ","Belize"],["BJ","Benin"],["BM","Bermuda"],["BT","Bhutan"],["BO","Bolivia"],["BQ","Bonaire, Sint Eustatius and Saba"],["BA","Bosnia and Herzegovina"],["BW","Botswana"],["BV","Bouvet Island"],["BR","Brazil"],["IO","British Indian Ocean Territory"],["VG","British Virgin Islands"],["BN","Brunei"],["BG","Bulgaria"],["BF","Burkina Faso"],["BI","Burundi"],["KH","Cambodia"],["CM","Cameroon"],["CA","Canada"],["CV","Cape Verde"],["KY","Cayman Islands"],["CF","Central African Republic"],["TD","Chad"],["CL","Chile"],["CN","China"],["CX","Christmas Island"],["CC","Cocos Islands"],["C
<?php
// Array With Kosovo Neighbours and their cities
function all_cities_array() {
return array(
"albania" => array(
array(
'city_name' => 'Ballsh',
'city_slug' => 'ballsh'
@jetonr
jetonr / neighbours.php
Last active August 29, 2015 14:08
Country Neighbours Array
<?php
function sc_embassy_countries() {
return array("Afghanistan","Albania","Algeria","Andorra","Angola","Antigua & Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Cook Islands","Costa Rica","Croatia","Cuba","Cyprus","Czech Republic","Democratic Republic of Congo","Denmark","Djibouti","Dominican Republic","East Timor","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Greenland","Grenada","Guatemala","Guinea","Guinea - Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Ivory Coast","Jamaica","Japan","