Skip to content

Instantly share code, notes, and snippets.

View ebi3102's full-sized avatar

Ebrahim Moeini ebi3102

View GitHub Profile
import threading
"""
it returns the price of gold per unit of mesghal form http://tgju.org
"""
def scraper():
# import libraries
import urllib.request
<?php
/**
*
*Title: Randome code generator
*Description: randomCodeGenerte($str , $count) generate random code frome $str that is a string. the length of code is equal the value of $count
* $str: a string that can be contain of numbers and charachters. the code create from it's charachters.
* $count: it is a integer that it's defult value is 1. it determineس the length of code would be generate.
*
**/
function randomCodeGenerate($str , $count = 1){
<?php
/**
* Template Name: Insert Itinerary Front End Page Layout
*Itinerary is a Custome Post Tyape that named itineraries
* @author Ebrahim Moeini
* @since 1.0.0
*below site help us to create this page
*https://tutsplus.com/authors/vinny-singh?_ga=2.94441311.216962670.1530158710-1100091547.1527395103
*/
?>
@ebi3102
ebi3102 / cpt-list.php
Last active August 29, 2018 11:15
custom post list for wordpress
<?php
/**
* @package Wordpress Theme
* @subpackage wordpress-theme
* @since Wordpress Theme 1.0
* Template Name: Template-post-list
*/
/* How to Use it
for use of this file you should copy it into your theme directory
then create a page in your wordpress admin dashboard and set it's template
@ebi3102
ebi3102 / get-ip.php
Created August 29, 2018 10:57
This snippet code show user IP adress and it's Browser
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Your IP Address</title>
</head>
<body>
<p>Your IP address followes:</p>
<div style="background: #ddd ; border:1px solid #999; font-weight: bold; font-size:20px; padding: 10px; width: 50%;">
<p>Your IP Address:
@ebi3102
ebi3102 / page.php
Created April 4, 2018 16:24
Display Child page into Parent Page in WordPress Snippet Code
<!-- Display Child page into Parent Page Snippet Code from
https://y-designs.com/tutorials/wordpress-displaying-subpages-on-pages/-->
<?php $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) );
foreach( $mypages as $page ) {
$content = $page->post_content;
if ( ! $content ) // Check for empty page
continue;
$content = apply_filters( 'the_content', $content ); ?>
@ebi3102
ebi3102 / top-menu.htm
Created April 4, 2018 15:15
Its a top menu that include to div in both sides of a page its use in Sinbad Trips theme
<html>
<head>
<meta name="viweport" content="width=device-width">
<style>
*{
box-sizing: border-box;
}
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
@ebi3102
ebi3102 / function.php
Last active April 4, 2018 14:20
this snippet code is about adding custom post-type and custom taxonomy in WordPress theme and use in function.php
<?php
//Creat a new taxonomy Booking Categories
function sin_taxo(){
register_taxonomy( 'booking_category', 'booking',
array(
'labels' => array(
'name' => __('Booking Categories'),
'singular_name' => __('Booking Category'),
'add_new' => _x('Add New Category' , 'booking-category'),
'add_new_item' => __('Add New Category'),