Skip to content

Instantly share code, notes, and snippets.

t-shirt:
https://m.media-amazon.com/images/I/A13usaonutL._AC_CLa%7C2140%2C2000%7C81xiAJ-NWHL.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.0._UL1500_.png
long-sleeve:
https://m.media-amazon.com/images/I/B1JMiB%2B-dyS._AC_CLa%7C2140%2C2000%7CA1aEE7q6PpL.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.0._UL1500_.png
zip-hoodie:
https://m.media-amazon.com/images/I/B1FGy%2BbPeZS._AC_CLa%7C2140%2C2000%7C811gTq89IYL.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.0._UL1500_.png
tank-top:
{
"proxy": {
"blocked_count": 135,
"error_count": 1982,
"_id": "5d8308b52bc82412209687c4",
"ip": "admin:vietnam123@45.61.161.30:80",
"status": "live",
"note": "123894",
"__v": 0,
"last_use": "2019-10-10T02:16:14.280Z",
const parseAmzImageUrl = (imgurl) => {
// let imageURL =
// 'https://m.media-amazon.com/images/I/A1EHx4FHFjL._CLa%7C2140%2C2000%7CB1hNfKQcFOS.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.0._UL1500_.png';
let imageURL = decodeURIComponent(imgurl);
let imgData = imageURL.split('/I/');
let startURL = imgData[0];
imgData = imgData[1];
let fileInfo = path.parse(imageURL);
@shrimp2t
shrimp2t / app.js
Created September 19, 2019 02:58 — forked from joshnuss/app.js
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./permission"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
yarn
yarn install v1.17.3
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "firebase > @firebase/database@0.3.8" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/firestore@0.9.2" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/functions@0.3.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/messaging@0.3.7" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/storage@0.2.4" has unmet peer dependency "@firebase/app-types@0.x".
{
"id": 799,
"name": "Ship Your Idea",
"slug": "ship-your-idea-22",
"permalink": "https://example.com/product/ship-your-idea-22/",
"date_created": "2017-03-23T17:03:12",
"date_created_gmt": "2017-03-23T20:03:12",
"date_modified": "2017-03-23T17:03:12",
"date_modified_gmt": "2017-03-23T20:03:12",
"type": "variable",
<?php
/**
* Plugin Name: Disable HTTP Request SSL Veryify
* Plugin URI: #
* Description: A products manager for woocommerce
* Version: 1.0.0
* Author: shrimp2t
* Author URI: https://github.com/shrimp2t/
* Text Domain:
*/
@shrimp2t
shrimp2t / Grunt.js
Last active May 3, 2019 09:01
Grunt JS
module.exports = function( grunt ) {
'use strict';
var pkgInfo = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
rtlcss: {
options: {
// rtlcss options
config: {
<?php
class Wishlist_Plus_Product {
public function __construct() {
add_action( 'woocommerce_single_product_summary', array( $this, 'add_button_hook' ), 35 );
add_action( 'woocommerce_after_shop_loop_item', array( $this, 'add_button_hook' ), 100 );
add_action( 'wp_footer', array( $this, 'wishlist_modal_template' ), 100 );
}
public function wishlist_modal_template() {
if ( wishlist_plus()->get_limit() <= 1 ) {
<?php
// The function to count words in Unicode strings
function count_unicode_words( $unicode_string ){
// First remove all the punctuation marks & digits
$unicode_string = preg_replace('/[[:punct:][:digit:]]/', '', $unicode_string);
// Now replace all the whitespaces (tabs, new lines, multiple spaces) by single space
$unicode_string = preg_replace('/[[:space:]]/', ' ', $unicode_string);
// The words are now separated by single spaces and can be splitted to an array
// I have included \n\r\t here as well, but only space will also suffice
$words_array = preg_split( "/[\n\r\t ]+/", $unicode_string, 0, PREG_SPLIT_NO_EMPTY );