Skip to content

Instantly share code, notes, and snippets.

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

Ga Satrya gasatrya

🏠
Working from home
View GitHub Profile
// src/LoginForm.js
import React from "react";
import { Form, Input, Button, Checkbox, Typography } from "antd";
const { Title } = Typography;
const LoginForm = () => {
const onFinish = (values) => {
console.log("Success:", values);
// Handle login logic with the values
@gasatrya
gasatrya / table.md
Created August 12, 2024 19:27
Top Lead Generation Plugins
Plugin Name Best For Price Ease of Use Key Features
OptinMonster Conversion optimization Starting at $9/month 9/10 Drag-and-drop builder, A/B testing, exit-intent technology, advanced targeting & triggers.
Thrive Leads Comprehensive list building One-time fee starting at $67 8/10 Opt-in forms, A/B testing, actionable analytics, seamless integration with Thrive themes.
WPForms User-friendly form builder Free; Premium starts at $39.50/year 9/10 Drag-and-drop form creation, customizable templates, entry management, marketing integrations.
@gasatrya
gasatrya / pass.md
Created August 10, 2024 06:18
Medium article
Password Strength Characteristics
Weak Short, common words or phrases
Medium Mix of letters and numbers, but easily guessable
Strong Mix of letters, numbers, and special characters, at least 12 characters long
@gasatrya
gasatrya / tab.tsx
Last active November 22, 2023 15:36
Radix UI Tabs URL based in next.js
import React from "react";
import { useRouter } from "next/router";
import * as Tabs from "@radix-ui/react-tabs";
const TabsDemo = () => {
const router = useRouter();
const initialTab = router.query.tab;
const [activeTab, setActiveTab] = React.useState(initialTab || "tab1");
const handleTabChange = (value) => {
@gasatrya
gasatrya / tab.tsx
Created November 22, 2023 06:29
Shadcn UI / Radix Primitives: Programmatically Switch Tabs
export function TabsDemo() {
const [tab, setTab] = useState("tab1");
const onTabChange = (value) => {
setTab(value);
}
return (
<Tabs value={tab} onValueChange={onTabChange} className="w-[400px]">
<TabsList className="grid w-full grid-cols-2">
@gasatrya
gasatrya / fetch_plugin.js
Created October 17, 2022 18:34 — forked from cwhittl/fetch_plugin.js
Using Fetch with Wordpress Plugins Ajax
fetch(ajax_url, {
method: 'POST',
credentials: 'same-origin',
headers: new Headers({'Content-Type': 'application/x-www-form-urlencoded'}),
body: 'action=zget_profile_user'
})
.then((resp) => resp.json())
.then(function(data) {
if(data.status == "success"){
_this.setState({loaded:true,user:data.user});
@gasatrya
gasatrya / wpmudev-forminator-editor-access.php
Created October 12, 2022 13:57 — forked from wpmudev-sls/wpmudev-forminator-editor-access.php
[Forminator] Grants Full Acesses For Editor Role. This plugin allows users with the editor role to have full access (view and save) to the Forminator administrative pages.
<?php
/**
* Plugin Name: [Forminator] Grants Full Access For Editor Role.
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin allows users with the editor role to have full access (view and save) to the Forminator administrative pages.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* Task: 0/11289012348292/1169742392170370
* License: GPLv2 or later
*
@gasatrya
gasatrya / wsl2-ubuntu-lamp.md
Created August 8, 2022 14:13 — forked from abobija/wsl2-ubuntu-lamp.md
LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

Apache

sudo apt-get update && sudo apt-get upgrade 
sudo apt-get install -y apache2

PHP

@gasatrya
gasatrya / forminator-load-cpt-select-field.php
Created July 18, 2022 12:51 — forked from wpmudev-sls/forminator-load-cpt-select-field.php
[Forminator] Load custom posts on Select Field and get IDs on the on-change event.
<?php
/**
* Plugin Name: [Forminator] Load custom posts on Select Field and get IDs on the on-change event.
* Plugin URI: https://wpmudev.com/
* Description: With the ID retrieved on the "on change" event, you can write your custom code to get the post data and fill the correspondent fields on the form, more details about how to do it on the comment of this snippet.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://wpmudev.com/
* Task: SLS-3568
* License: GPLv2 or later
*
@gasatrya
gasatrya / category.php
Created June 9, 2015 14:55
WordPress: If the post has several categories, display the first one only.
<?php
$category = get_the_category( get_the_ID() );
if ( $category ) :
?>
<span class="entry-category">
<a href="<?php echo esc_url( get_category_link( $category[0]->term_id ) ); ?>"><?php echo esc_attr( $category[0]->name ); ?></a>
</span>
<?php endif; // End if category ?>