Skip to content

Instantly share code, notes, and snippets.

View donjajo's full-sized avatar
🏠
Working from home

James John donjajo

🏠
Working from home
View GitHub Profile
@donjajo
donjajo / id.c
Created June 13, 2019 22:08
Simple replica of `id` command
#include <stdio.h>
#include <pwd.h>
#include <unistd.h>
#include <stdlib.h>
#include <grp.h>
#include <string.h>
void main( int argc, char *argv[] ) {
struct passwd *user;
struct group *group;
@donjajo
donjajo / google_product_data_specifications.json
Last active January 8, 2021 12:47
JSON format of Google Product Data Specification, as seen here - https://support.google.com/merchants/answer/7052112?hl=en
[
{
"slug": "id",
"description": "Your product’s unique identifier",
"schema": "Product.sku",
"group": "basic"
},
{
"slug": "title",
"description": "Your product’s name",
@donjajo
donjajo / catch.js
Last active January 8, 2021 13:31
Verify Unicode character on Google's page, to be used on this page - https://support.google.com/merchants/answer/7052112?hl=en
let table = document.getElementsByTagName("table")
tbodies = table[2].tBodies[0].children
for( let tr of tbodies ) { console.log( tr.children[0].textContent == tr.children[0].textContent.replace( /[^a-zA-Z0-9_-]/, "" ), `\nOriginal: ${tr.children[0].textContent}`, `\nSanitized: ${tr.children[0].textContent.replace( /[^a-zA-Z0-9_-]/, "" ) }`, `\nFound:`, tr.children[0].textContent.match(/[^A-Za-z0-9_-]/) ) }