Skip to content

Instantly share code, notes, and snippets.

@diomededavid
diomededavid / dropdownMenu.ts
Last active December 24, 2022 23:13
Typescript array for dropdown navigation menu component in React.js and daisy UI
/*
To create a dropdown navigation menu component in React using TypeScript, you can start by defining an interface for the menu items that will be displayed in the dropdown. This interface might include properties such as the label for the menu item, the destination URL, and any subitems that should be displayed in a submenu within the dropdown.
Next, you can create a component that accepts an array of menu items as a prop and uses this array to render the dropdown menu. For example:
*/
import * as React from 'react';
Git commands Cheat Sheet
Initialize a new git repository:
git init
Set configuration values for your username and email:
git config --global user.name <your-name>
git config
--global user. email <your-email>
Clone a repository:
@diomededavid
diomededavid / field.php
Created September 27, 2021 19:49 — forked from Xilonz/field.php
Sage 9 Carbon Field Blocks
<?php
namespace App;
use Carbon_Fields\Field;
use Carbon_Fields\Block;
Block::make( __( 'Gutenberg Block' ) )
->set_icon( 'format-chat')
->add_fields( array(
Field::make( 'rich_text', 'text', __( 'text', 'my-theme' ) )
@diomededavid
diomededavid / twitter_schema.php
Created July 18, 2021 00:59
Twitter Schema Plugin
<?php
/*
Plugin Name: Twitter Schema
Plugin URI: https://digitalblender.co
Description: Twitter Schema
Author: Prahlad Yeri
Version: .1
Author URI: https://prahladyeri.com/blog
*/
@diomededavid
diomededavid / sharethis.php
Created February 16, 2021 20:32
sharethis
<aside class="share-honor-roll">
<p class="share-honor-roll-text">Share this Honor Roll</p>
<div class="share-honor-roll-actions">
<div class="addthis_inline_share_toolbox"></div>
</div>
</aside>
@foreach($project_loop as $project_item)
{!! $project_item !!}
@endforeach
@diomededavid
diomededavid / gist:1a3a6e15fe145e483c462320556fb7cb
Created April 25, 2020 02:02
Cloudflare Whitelist for Digital Ocean IPV$ and IP
## This file was meant to make it easy to update IP tables for Cloudflare
## Use at your own risk.
## I will not and do not assume any resposibilty for any actions you take to update your servers.
## Before using for Additional info Please refer to:
https://support.cloudflare.com/hc/en-us/articles/201897700
https://www.cloudflare.com/ips/
iptables -I INPUT -p tcp -m multiport --dports http,https -s 173.245.48.0/20 -j ACCEPT
class Toggle extends React.Component {
constructor(props) {
super(props);
this.state = {isToggleOn: true};
// This binding is necessary to make `this` work in the callback
this.handleClick = this.handleClick.bind(this);
}
true = 'Im On!';
@diomededavid
diomededavid / custom_post_feature_img.php
Last active August 5, 2018 23:35
Set featured image in css, so background image can be set without usin inline styles
<?php
/**
* Add or remove the css class if the featured image is set or not
*/
function custom_post_feature_img()
{
if ( has_post_thumbnail() ) {
echo 'custom-post-feature-img';
Farm-to-table pharetra proin auctor fixie nam sem urna indie integer integer ipsum bahn mi nec nibh molestie brunch vitae quam. Maecenas bicycle commodo nec vulputate organic tempus sem elementum craft beer a eros lorem hoodie nulla proin congue vegan mattis. Morbi et craft beer lorem enim quam noise-rock maecenas fusce integer wire-rimmed glasses vitae porttitor lectus before they sold out quam. Nibh cursus you probably haven't heard of them et vitae lectus skateboard lectus gravida vulputate Portland lorem tellus eros vim ipsum. Duis ipsum Portland enim ipsum odio vinyl eros fusce justo indie proin sit donec Brooklyn gravida urna congue fixie. Vivamus sodales elementum VHS morbi odio ultricies wire-rimmed glasses odio rutrum sapien farm-to-table non sapien molestie DIY.
[draft_pick rank="auto" first_name="Yeti" last_name="Roberts" position="QB" school="Georgetown" league="nfl" team="124" link_url="https://fansided.com" link_text="Scouting Report" link_url2="https://fansided.com" link_text2="Pick Analysis"