Categories
CMS Drupal Mastering Development

How to add wrapper to article teaser content

I need to add a wrapper around the title, body, id, and created fields of the teaser below but am not familiar with how to implement this in a twig template. I need to have the image in a seperate container from the rest of the content:

Categories
Mastering Development

How to extract same parts of file name with different patterns?

I have the following file name formats: 2020-01-05-ABC1111_001.jpg 2020_02_06_B444444_MN_004.jpg 2020_03_20_KUKU44223222-STAFF_005.jpg 2020-04-03-LULU4444211-MN_018.jpg Most (99%) of the files are of the following format: 2020_04_03_LULU4444211_018.jpg And I just use rsplit("_", 2) and get what I need. Where the first part is date, second is and ID, MN or STAFF, page number. How to build a good regex or […]

Categories
Mastering Development System & Network

Azure Roles – Explicit access on storage service – file share

I need to configure a custom azure role which will give a user an explicit access to a file share ((with File Explorer). But the user shouldn’t have access to the other services of the Storage service like blob storage, queue or tables. Currently with the following json file the user can see all sub-servives […]

Categories
Game Creation Mastering Development

Object destroyed when applying WebCamTexture across Photon

This script turns the texture from WebCamTexture into a byte array to send across Photon as an RPC. However, when it is called, it displays the WebCamTexture for 1 frame before destroying the entire GameObject it is applied to. The gameobject is this case is a prefab with a cube that is instantiated after joining […]

Categories
CMS Mastering Development Wordpress

WooCommerce WebHook Retry

I am trying to implement webhook retry with woocommerce. I see where they publish the webhook notification at https://github.com/woocommerce/woocommerce/blob/5ba2cdafa58c5a02d44eebbab1e8fe26f295e4aa/includes/class-wc-webhook.php#L353, but there is no reference to $this. Is it possible to get a webhook object by id instead? Then I could keep it in memory and retry after some delay and/or put something in db for […]

Categories
Mastering Development

Document not getting deleted in firestore

I’m using Vuex form my state management in my web app. I wanted to delete a document from my firestore database but when I click the button nothing happens. This is segement of the card header with a delete icon so when clicked it deletes the document: <div class="card"> <div class="card-header card-head-color"> <span class="card-header-text" > […]

Categories
Mastering Development

Ruby create new hash from another hash with specific values from first hash

I’ve got below hash from webhook requests: webhook = {"environment"=>"master", "entity_type"=>"item", "event_type"=>"publish", "entity"=> {"id"=>"5267370", "type"=>"item", "attributes"=>{"title"=>"new text webhook", "is_separate_activity"=>false, "short_description"=>"webhook", "long_description"=>"new text webhook", "text"=>["5267545"], "author"=>"test", "reading_time"=>"4 min", "updated_at"=>"2020-07-06T13:25:30.599+01:00", "created_at"=>"2020-07-06T12:41:45.495+01:00"}, "relationships"=>{"item_type"=>{"data"=>{"id"=>"245189", "type"=>"item_type"}}, "creator"=>{"data"=>{"id"=>"7243", "type"=>"user"}}}, "meta"=>{"created_at"=>"2020-07-06T12:41:45.495+01:00", "updated_at"=>"2020-07-06T13:25:30.599+01:00", "published_at"=>"2020-07-06T13:25:30.599+01:00", "publication_scheduled_at"=>nil, "first_published_at"=>"2020-07-06T12:41:45.511+01:00", "is_valid"=>true, "status"=>"published", "current_version"=>"9718212"}}} I need to store only basic information from that hash: webhook.dig(‘entity’, ‘id’), webhook.dig(‘entity’, ‘attributes’, […]

Categories
Mastering Development

include “0” count result in clickhouse

I have one t_table(some_date, id), and i want get count of ids for each day between two input dates. I try this query: SELECT dateDiff(‘day’, toDateTime(‘2020-07-01 07:34:22’), some_date) as day, count(distinct id) as ids, from t_table where (some_date between ‘2020-07-01 00:09:25’ and ‘2020-07-15 21:09:25’) group by day order by day; This query returns day only […]

Categories
Mastering Development

Removing specific lines/rows or duplicates from a file in Linux

I want to remove specific rows from a .csv file (named ‘mydata’) on Linux using values under a specific variable ‘SAMPLE’. I actually have 250 duplicates in my file that in original have 15000 rows and 66 columns and I want to remove one copy of each duplicate and keep the one. If you look […]

Categories
Linux Mastering Development

using awk how can i make row so i need to have 14-0273 under ID so making different columns for different stuff

ID,Date,DateType,Age,Sex,Race,ResidenceCity,ResidenceCounty,ResidenceState,DeathCity,DeathCounty,Location,LocationifOther,DescriptionofInjury,InjuryPlace,InjuryCity,InjuryCounty,InjuryState,COD,OtherSignifican,Heroin,Cocaine,Fentanyl,FentanylAnalogue,Oxycodone,Oxymorphone,Ethanol,Hydrocodone,Benzodiazepine,Methadone,Amphet,Tramad,Morphine_NotHeroin,Hydromorphone,Other,OpiateNOS,AnyOpioid,MannerofDeath,DeathCityGeo,ResidenceCityGeo,InjuryCityGeo 14-0273,06/28/2014 12:00:00 AM,DateReported,,,,,,,,,,,substance,,,,,"Acute fent, hydrocod, benzodiazepine",,,,Y,,,,,Y,Y,,,,,,,,,Accident,"CT (41.575155, -72.738288)","