Skip to content

Instantly share code, notes, and snippets.

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

Tony Sanjaya sanjayatony

🏠
Working from home
View GitHub Profile
@sanjayatony
sanjayatony / config
Created May 16, 2022 01:36
github config
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github.com-plasticbank
Hostname github.com
User git
IdentityFile ~/.ssh/id_rsa_plasticbank
@sanjayatony
sanjayatony / states.md
Created April 27, 2022 06:03
US States

AL : Alabama AK : Alaska AZ : Arizona AR : Arkansas CA : California CO : Colorado CT : Connecticut DE : Delaware DC : District of Colombia FL : Florida

@sanjayatony
sanjayatony / index.md
Created April 27, 2022 04:17
New Public Gist

‎‎​

// Place your settings in this file to overwrite the default settings
{
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"editor.minimap.enabled": false,
"workbench.startupEditor": "none",
"editor.renderControlCharacters": false,
"editor.fontLigatures": true,
"editor.renderWhitespace": "none",
"editor.overviewRulerBorder": false,
@sanjayatony
sanjayatony / wp-query.php
Last active November 3, 2020 12:41
WP Query
<?php
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
}
echo '</ul>';
} else {
@sanjayatony
sanjayatony / install-tailwind.php
Created July 23, 2020 06:51
Install tailwind
<?php
?>
@sanjayatony
sanjayatony / debug
Created May 16, 2017 03:04
facetWP debug
{"facets":[{"label":"Case Study Area","name":"cs_area","type":"dropdown","source":"cf\/practice_areas","label_any":"Any","parent_term":"","orderby":"count","hierarchical":"no","count":"9999"}]}
@sanjayatony
sanjayatony / theme.liquid
Last active January 30, 2017 04:53
Add number of products in a collection
{% for link in linklists.your_menu.links %}
COUNT: {{ link.object.all_products_count }} <br>
{% endfor %}
@sanjayatony
sanjayatony / plugin.php
Last active July 4, 2016 06:06
add reading time in twitter card, so it will show up when unfurl
<?php
/*
Plugin Name: Reading Time
Plugin URI: http://wordpress.org/extend/plugins/estimated-post-reading-time/
Description: Calculates an average required time to complete reading a post.
Version: 1.4
Author: Konstantinos Kouratoras
Author URI: http://www.kouratoras.gr
Author Email: [email protected]
@sanjayatony
sanjayatony / loop.php
Last active November 3, 2020 12:29
loop custom post type
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => 4,
'paged' => $paged
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();?>
<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
<span class="date"><?php the_date();?></span>