Skip to content

Instantly share code, notes, and snippets.

View dvdopi's full-sized avatar

David Odhiambo dvdopi

View GitHub Profile
@dvdopi
dvdopi / gist:0d5f8754ecd73e78c3c3f6160c3d557c
Created August 26, 2022 06:57
install_codedeploy_agent_linux.sh
sudo yum update
sudo yum install ruby
sudo yum install wget
wget https://{bucket-name}.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
## bucket-name represents one of the following:
## aws-codedeploy-us-east-1 for instances in the US East (N. Virginia) region
## aws-codedeploy-us-west-1 for instances in the US West (N. California) region
@dvdopi
dvdopi / gist:8fded72069c7df0794591d3820200446
Created January 28, 2021 01:26
Css static background
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@dvdopi
dvdopi / gist:4b39b4fb1ce72f8fefdce0ce97fe6451
Created September 1, 2020 08:36
add git ignore on already existing directory
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
Open the sql file in your text editor;
1. Search: utf8mb4_unicode_ci Replace: utf8_general_ci (Replace All)
2. Search: utf8mb4_unicode_520_ci Replace: utf8_general_ci (Replace All)
3. Search: utf8mb4 Replace: utf8 (Replace All)
@dvdopi
dvdopi / gist:b6af5b8c5230e7bb2677703886a8f92f
Created May 19, 2020 11:03
Angular htaccess that eliminates 404 on page refresh or when accessing inner links
<IfModule mod_rewrite.c>
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html
# to allow html5 state links
##Git global setup
git config --global user.name "Yourname"
git config --global user.email "email"
##Create a new repository
git clone <httpslink>
cd directory
touch README.md
git add README.md
git commit -m "add README"
@dvdopi
dvdopi / gist:9076f7daa428a2df6a47af344dbdbf17
Created April 17, 2020 08:48
wordpress - get all taxonomy items of a particular taxonomy
$categories = get_terms(array(
'taxonomy' => 'taxonomy-slug',
'hide_empty' => false,
'order' => 'DESC'
));
foreach ($categories as $category) {
Print_r($category);
}
@dvdopi
dvdopi / gist:a9f6dc9153beed19a423635c5ab6595c
Created April 17, 2020 08:46
wordpress - get taxonomy of a post type
get_terms([
'taxonomy' => 'gallery-item',
'hide_empty' => false,
]);
@dvdopi
dvdopi / gist:9386bc62ae717c95fa2e76a9aa29030a
Created April 17, 2020 08:45
wordpress -get object of Advance custom field
$field = get_field_object('custom field name');
$field = $field['value'];
@dvdopi
dvdopi / gist:312bdad0e74214490320ba4ceabc250f
Created April 17, 2020 08:43
Wordpress - get custom post type
the_field('cpt_slug', get_the_ID())