Categories
Linux Mastering Development

birth/crtime timestamp is recorded on one xfs but not the other xfs filesystem

Two different xfs filesystems on two different Fedora. Why one of them records Birth(crtime) in the inode and why the other one doesn’t? How to find the configuration/attribute differences between the two filesystems? #1 XFS v5 (Fedora 30): # stat tea.txt File: tea.txt Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: fd01h/64769d […]

Categories
CMS Mastering Development Wordpress

Oembed support for private Google Drive previews

I have a wordpress intranet for my company where I want to insert previews (i.e. iframes) of some of the company’s private PDF files that are stored in Google Drive. So I don’t want those files to be available to the world, but just to employees who have access to those files. What I’m looking […]

Categories
CMS Mastering Development Wordpress

Oembed support for private Google Drive previews

I have a wordpress intranet for my company where I want to insert previews (i.e. iframes) of some of the company’s private PDF files that are stored in Google Drive. So I don’t want those files to be available to the world, but just to employees who have access to those files. What I’m looking […]

Categories
CMS Mastering Development Wordpress

Oembed support for private Google Drive previews

I have a wordpress intranet for my company where I want to insert previews (i.e. iframes) of some of the company’s private PDF files that are stored in Google Drive. So I don’t want those files to be available to the world, but just to employees who have access to those files. What I’m looking […]

Categories
CMS Mastering Development Wordpress

How do I exclude recent post from recent post php widget

I have this code, and I tried adding in post__not_in as suggested by another post I found on this website, and it didn’t break anything but didn’t work either. I also tried different examples. Here’s the php code I have <?php $args = array( ‘posts_per_page’ => ‘4’, ‘post__not_in’ => array($currentID) ); $recent_posts = new WP_Query($args); […]

Categories
Mastering Development

multithreading program to perform word count frequency- Segmentation fault

#include <stdio.h> #include <string.h> #include <stdlib.h> #include <pthread.h> #include <sys/mman.h> #include <sys/types.h> #include <fcntl.h> #include <sys/stat.h> #include <unistd.h> #include <time.h> pthread_mutex_t lock; //typedef struct for a word typedef struct { char word[101]; int frequency; }Word; //struct for thread struct ft{ char* fileName; int start; int stop; }; //compare frequency of 2 words int compareWords(const void […]

Categories
Mastering Development

std::thread crash in Debug mode (Work in run) with Netbeans/Cygwin

I’m trying to debug (GDB) my application developped with Cygwin under Windows. When I debug this, I got “Signal received: ? (Unknown signal)” when the thread is created and the program stop. #include <iostream> #include <thread> using namespace std; void ConnectionTimer() { } int main(int argc, char** argv) { cout<<“Before thread creation”<<endl; std::thread t( ConnectionTimer); […]

Categories
CMS Development Wordpress

Register Embed Handler for Padlet.com

I’m trying and failing to register an embed code for content from padlet.com (strangely it’s supported in WP.com but not WP.org). A URL like https://padlet.com/cogdogblog/aos9fosbbwk4 should embed like <div class=”padlet-embed” style=”border:1px solid rgba(0,0,0,0.1);border-radius:2px;box-sizing:border-box;overflow:hidden;position:relative;width:100%;background:#F4F4F4″><p style=”padding:0;margin:0″><iframe src=”https://padlet.com/embed/aos9fosbbwk4″ frameborder=”0″ allow=”camera;microphone;geolocation” style=”width:100%;height:608px;display:block;padding:0;margin:0″></iframe></p> My attempt that fails so far add_action( ‘init’, function(){ $regex_url = ‘#https?://padlet\.com/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$#i’; wp_embed_register_handler( ‘padlet’, $regex_url, ‘wp_embed_handler_padlet’, true […]

Categories
Development

Ember data – use property other than id for hasMany relationship

I have a many-to-many relationship defined between my tag and payment models as shown below. //models/tag.js import Model, { attr, hasMany } from ‘@ember-data/model’; export default Model.extend({ name: attr(‘string’), backgroundColour: attr(‘string’), textColour: attr(‘string’), payments: hasMany(‘payment’) }); // models/payment.js import Model, { attr, hasMany } from ‘@ember-data/model’; export default Model.extend({ date: attr(‘date’), amount: attr(‘number’), paymentId: attr(‘string’), […]

Categories
CMS Development Wordpress

Register an embed handler for self hosted images

Background of my Problem: I have several hundred images with urls stored in a Toolset Types custom wordpress embedded field, along with video urls. I can display my videos no problem from the embedded field but the images only show the URL not the image. Solution approach: I’m trying to write a function to register […]