Skip to content

Instantly share code, notes, and snippets.

@jesders
jesders / tailwind.config.js
Last active September 26, 2023 18:03
NCCRT Components
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&family=Source+Sans+3:wght@200;300;400;500;600;700;800;900&family=Source+Serif+4:opsz,wght@8..60,200;8..60,300;8..60,400;8..60,500;8..60,600;8..60,700;8..60,800;8..60,900&display=swap');
</style>
<div class="antialiased">
<div>
<p>Buttons for white bg</p>
<div class="flex gap-10 p-4">
<!-- Filled -->
<div class="flex flex-col flex-wrap gap-4">
https://play.tailwindcss.com/Y1JC8vU5sO
@jesders
jesders / cloudSettings
Last active June 8, 2021 21:17
VS Code Settings
{"lastUpload":"2021-06-08T21:17:22.450Z","extensionVersion":"v3.4.3"}
@jesders
jesders / functions.php
Last active May 14, 2020 19:08
WordPress / Passing parameters to function call.
<?php
// Steps to passing function to array
// 1. Make parameters to add to function
// 2. Set up function and pass parameter
// 3. Register function via add_action
// 4. Call do_action passing in the parameters needed
$array = array('1', '2', 3, 4);
function a_hooked_function($array) {
var_dump($array);
@jesders
jesders / gist:54cc7e828973f6db83d233806ecf96ef
Created May 8, 2020 18:02
Get Parent -> Child Terms (With or Without Custom Taxonomy)
<nav>
<?php
foreach( get_terms( 'tax_pipeline', array( 'hide_empty' => true, 'parent' => 0 ) ) as $parent_term ) {
// display top level term name
echo $parent_term->name . '<br>';
foreach( get_terms( 'tax_pipeline', array( 'hide_empty' => true, 'parent' => $parent_term->term_id ) ) as $child_term ) {
// display name of all childs of the parent term
echo '>>>>>' . $child_term->name . '<br>';
}
@jesders
jesders / gist:3a6530a1fc399245c09ab73e64db2f07
Created April 24, 2020 13:23
Setting single post template in WordPress
https://codex.wordpress.org/Plugin_API/Filter_Reference/single_template
<?php
function get_custom_post_type_template( $single_template ) {
global $post;
if ( 'my_post_type' === $post->post_type ) {
$single_template = dirname( __FILE__ ) . '/post-type-template.php';
}
@jesders
jesders / gist:1a3155dd2c5eb7d0a7c36f81993af2f1
Created April 15, 2020 16:17
Grab all $_POST variables and build an array
<?php
$posts = array();
foreach($_POST as $key => $value):
// if(!in_array($key, $_POST) && !empty($value)) {
// $posts[$key] = $value;
// }
if(!in_array($key, $_POST)) {
$posts[$key] = $value;
}
@jesders
jesders / gist:e02d99d3fe88011648b05ee1ba43e09b
Created April 15, 2020 12:25 — forked from ivandoric/gist:e4e46294c4d35eac0ec8
wordpress: create custom reset password page
<?php //Add all of this tu custom page template ?>
<?php
global $wpdb;
$error = '';
$success = '';
// check if we're in reset form
if( isset( $_POST['action'] ) && 'reset' == $_POST['action'] )
{
@jesders
jesders / gist:40281204ff9dd8cf18a5020e104a6248
Created April 15, 2020 12:24 — forked from ivandoric/gist:11215045
shell: SCP cheat sheet
Copy the file "foobar.txt" from a remote host to the local host
$ scp your_username@remotehost.edu:foobar.txt /some/local/directory
Copy the file "foobar.txt" from the local host to a remote host
$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory
Copy the directory "foo" from the local host to a remote host's directory "bar"
$ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar
Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"
tar -cvzf backup.tar * //packing
tar zxvf file_name.tar.gz * //unpacking