Skip to content

Instantly share code, notes, and snippets.

View wildrain's full-sized avatar
🕶️
I may be slow to respond.

Roman Ul Ferdosh wildrain

🕶️
I may be slow to respond.
  • Dhaka, Bangladesh
View GitHub Profile
<template>
<div id="layout">
<div id="container">
<div class="inner">
<div class="row">
<div class="col-lg-4">
<div class="card mb-0">
<div class="card-header">
<h5 class="m-0 card-header-title">Products</h5>
</div>
Anonymous UUID: 35FD4EB9-8113-044A-D904-C84F0D173836
Sun Dec 29 00:26:04 2019
*** Panic Report ***
panic(cpu 0 caller 0xffffff80038da29d): Kernel trap at 0xffffff7fac8d1260, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0xffffff7fac8d1260, CR3: 0x00000000075ee000, CR4: 0x00000000001626e0
RAX: 0xffffff8015f9c3d0, RBX: 0xffffff8015f6dd40, RCX: 0x0000000000000000, RDX: 0xffffff8015f9c3d0
RSP: 0xffffff80e4bd3a18, RBP: 0xffffff80e4bd3a40, RSI: 0xffffff8015f6dd40, RDI: 0xffffff800425f4e0
R8: 0xffffff8015f9c3d0, R9: 0xffffff800422da48, R10: 0xffffff800409d7c0, R11: 0x0000000000000000
https://codepen.io/matedon/pen/BZQymW?editors=1010
@wildrain
wildrain / read_file_content.php
Created August 18, 2019 07:40
Read Content From Json or any type of file in WordPress
<?php
function houstonwp_get_file_content($url)
{
global $wp_filesystem;
require_once(ABSPATH . '/wp-admin/includes/file.php');
WP_Filesystem();
$content = '';
if ($wp_filesystem->exists($url)) {
@wildrain
wildrain / functions.php
Created December 5, 2018 07:39 — forked from scottparry/functions.php
Enqueue Google fonts in WordPress theme
/**
* Enqueue custom fonts using protocol relative URL.
*
* Syntax: wp_enqueue_style( $handle, $src, $deps, $ver, $media );
* Ensure $handle is unique to prevent conflicts with plugins
*
* Note(s): The pipe (|) operator is used to load multiple typefaces in a single call. We also only load the weights we want * by comma seperating them, instead of loading every available weight.
*/
function theme_prefix_fonts()
{
@wildrain
wildrain / userphoto1.php
Created October 5, 2018 10:51
Upload userphoto in user admin area
<?php
/**
* Adds additional user fields
* more info: http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields
*/
function additional_user_fields( $user ) { ?>
<h3><?php _e( 'Additional User Meta', 'textdomain' ); ?></h3>
@wildrain
wildrain / php-block.js
Created September 26, 2018 03:13 — forked from pento/php-block.js
Converting a shortcode to a block
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
Issue:
The traditional UNIX system directories (/usr, /var, /etc) are hidden by default on Mac OS X, and it is not possible to navigate to them via Finder. Many Autodesk license and configuration files reside in these folders.
This article provides instructions on unhiding those folders, to be able to work with them.
Solution:
To navigate to a hidden system folder from the Finder:
Open Finder.
Press Command+Shift+G.
<?php
/**
* check if a value exist in multi-dimentional array
*
* Recusive function
* @since 2.0.4
*/
function in_array_r($needle, $haystack, $strict = false) {
foreach ($haystack as $item) {
<?php
$serialized = 'a:2:{i:46;a:2:{s:5:"title";s:21:"Quique Inventory Name";s:12:"inventory_id";i:46;}i:47;a:2:{s:5:"title";s:22:"Another inventory name";s:12:"inventory_id";i:47;}}';
$fixed = preg_replace_callback(
'/s:([0-9]+):"(.*?)";/',
function ($matches) { return "s:".strlen($matches[2]).':"'.$matches[2].'";'; },
$serialized
);
$original_array=unserialize($fixed);