Skip to content

Instantly share code, notes, and snippets.

View shash7's full-sized avatar

Shashwat amin shash7

View GitHub Profile
@shash7
shash7 / ad.json
Created July 29, 2025 09:11
Example ad data saved using facebookadlibrary.js | View the ad here: https://swipekit.app/block/89d112a2-d437-49b7-a106-56924b35b756
{
"id": "3269878269817577",
"ad_creation_time": "2025-07-27",
"ad_creative_bodies": [
"Hey, meet your new skin-saving hero! 🌟 The Peptide Firm Bounce Foundation is the ultimate fusion of skincare and makeup! It hydrates deeply, plumps aging skin, and gives you buildable, weightless coverage that smooths fine lines and blurs imperfections. Infused with peptides, Reishi Mushroom, Vitamins C & E, and Aloe Extract, this foundation nourishes your skin for a radiant, healthy glow. 100% of users saw improved bounce, smoother crepiness, and softer, more hydrated skin! Why we love it It’s not just makeup—it’s a skin reset! Plus, get a FREE professional makeup brush! Limited stock—act fast! 🎉✨https://t.site/3TXGKVu"
],
"ad_creative_link_captions": [
"www.zealangel.com"
],
"ad_creative_link_titles": [
@shash7
shash7 / ops.php
Last active March 12, 2025 19:55
<?php
function ops($event_name, $data) {
$url = "https://api.operational.co/api/v1/ingest";
$token = "YOUR_API_KEY"; // get a free one from operational.co
$args = array(
'body' => json_encode(array_merge(['name' => $event_name, 'notify' => true], $data)),
'headers' => array(
'Authorization' => 'Bearer ' . $token,
'Content-Type' => 'application/json'
@shash7
shash7 / npmlist.txt
Created August 29, 2020 12:52
Dependency dump
+-- @microlink/[email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- @sindresorhus/[email protected]
| | +-- @szmarczak/[email protected]
| | | `-- [email protected]
| | +-- @types/[email protected]
| | | +-- @types/[email protected]
| | | +-- @types/[email protected]
| | | | `-- @types/[email protected] deduped
class NodeUtils {
static path(node) {
let tests = []
// if the chain contains a non-(element|text) node type, we can go no further
for (;
node && (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.TEXT_NODE);
@shash7
shash7 / sample-nuxt.config.js
Last active August 9, 2025 09:52
A SEO optimized nuxtjs config file. Comes with all standard meta tags as well as social tags. Quick configuration. Read the comments first before integrating in your config file.
/**
* Before copy-pasting this code inside your nuxt config file, read the instructions first.
*
* 1. Go to https://realfavicongenerator.net/ and generate a bunch of favicons.
* It will take only 5 minutes to generate them(assuming you have a base favicon in 512x512 size ready)
* When generating the favicons select the path directory as /favicons
* 2. Make a facebook cover image. Use something like figma or canva to create one quickly. Name the file cover.jpg
* 3. Inside your nuxt project create a folder called favicons and dump all the favicon files(generated from the favicon generator)
* as well as the facebook cover image.
* 4. Configure the variables below to your liking. You can also change the delimiter.
use Carbon_Fields\Container;
use Carbon_Fields\Field;
add_action( 'carbon_fields_register_fields', 'crb_attach_theme_options' );
function crb_attach_theme_options() {
Container::make( 'theme_options', __( 'Theme Options', 'crb' ) )
->add_fields( array(
Field::make('text', 'crb_text', 'Text Field' ),
Field::make('association', 'crb_association', 'Association'),
Field::make('checkbox', 'crb_checkbox', 'Checkbox')
@shash7
shash7 / globals.js
Created June 18, 2016 10:20
Global variables for nodejs
/* jslint undef: true */
/* global window, document, $ */
/* ----------------------------------------------------------------
* globals.js
*
* Contains setters and getters to store and retrieve global vars
* ---------------------------------------------------------------- */
/*
* particle.js
*
* Originally taken from http://alexanderjam.es/
*
* Menu:
* globals
* class
* class functions
* utils
@shash7
shash7 / panelize
Created June 24, 2015 16:01
Turn text into panels to create a visual hierachy
var stretch = 1;
function parseRGB(input) {
m = input.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
if( m) {
return [parseInt(m[1]),parseInt(m[2]),parseInt(m[3])];
} else {
return null;
}
}
function normalize(num) {
@shash7
shash7 / cache.js
Created August 25, 2014 10:36
A simple cache for storing objects in javascript
/* jslint undef: true, vars: true */
/* global window, document, $ */
/*
* cache.js
*
* Used for caching objects in an array
*/