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 formated_result_add_order(WP_Post $result, $order) | |
{ | |
$item = []; | |
$item['order'] = $order[$result->post_type]["order"]; | |
$item['post_id'] = $result->ID; | |
$item['title'] = $order[$result->post_type]["title"]; |
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 | |
/** | |
* Filter Events CPT Using Custom Date Meta Field | |
* Meta Field in this instance created via Advanced Custom Fields | |
* | |
*/ | |
// Sort using pre_get_posts | |
add_action( 'pre_get_posts', 'wd_event_query_by_date' ); | |
function wd_event_query_by_date( $query ) { |
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 | |
public function give_user_subscription( $product, $user_id, $note = '' ){ | |
// First make sure all required functions and classes exist | |
if( ! function_exists( 'wc_create_order' ) || ! function_exists( 'wcs_create_subscription' ) || ! class_exists( 'WC_Subscriptions_Product' ) ){ | |
return false; | |
} | |
$order = wc_create_order( array( 'customer_id' => $user_id ) ); |
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 { useState, useEffect, useContext } from "react"; | |
import { Form, FormGroup, Alert } from "reactstrap"; | |
import { useFormik } from "formik"; | |
import * as Yup from "yup"; | |
import Link from "next/link"; | |
import Head from "next/head"; | |
import { useRouter } from "next/router"; | |
import LayoutAuth from "@components/layout/LayoutAuth"; | |
import { |
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 | |
/** | |
* Template Name: Compartir | |
*/ | |
$url = get_template_directory_uri() . '/shortlinks.su/'; | |
?> | |
<!DOCTYPE html> |
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
# Fuente: https://github.com/vercel/next.js/blob/canary/examples/with-docker/README.md | |
# Install dependencies only when needed | |
FROM node:16-alpine AS deps | |
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
COPY package.json yarn.lock ./ | |
RUN yarn install --frozen-lockfile |
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
// todo lo que escribas aqui es un comentario | |
/** | |
Variables: caja donde se almacena informacion | |
en javascripts las variables se declaran de 3 formas | |
var nombre = "hosni" | |
let nombre = "hosni" | |
const nombre = "hosni" |
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
from bs4 import BeautifulSoup | |
import requests | |
import re | |
url = 'https://www.xvideos.com/embedframe/38079261' | |
pattern = r'https://[a-z\-]+\.[a-z\-]+\.[\w\?\_\.\/]+' | |
r = requests.get(url) | |
print(r.status_code) |