Skip to content

Instantly share code, notes, and snippets.

View dompascal's full-sized avatar

Dominic Pascal dompascal

View GitHub Profile
@dompascal
dompascal / nginx-craft-cms-ssl-config
Last active August 15, 2020 09:58
SSL is generated by certbot with `sudo certbot nginx -d domain.com -d www.domain.com`
server {
root /var/www/hopefield/prod/web;
index index.php index.html index.htm index.nginx-debian.html;
server_name domain.com www.domain.com;
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
@dompascal
dompascal / index.html
Last active August 13, 2020 17:50
Instafeed
<!-- access token service -->
<script src="https://dompascal-instafeed.herokuapp.com/token.js"></script>
<!-- instafeed.js library (dont use in production) -->
<script src="https://cdn.jsdelivr.net/gh/stevenschobert/[email protected]/src/instafeed.min.js"></script>
<h1>Instagram Feed with basic display API</h1>
<div id="instafeed">instagram feed</div>
<script type="text/javascript">

GIT

Git checkout

alias gc="git checkout"

Git pull

alias gpull="git pull origin"

Git push

alias gpush="git push origin"

@dompascal
dompascal / git_reset_commit.md
Last active April 12, 2020 17:23
Use GIT revert if you would like to remove specific git commits from your repo. If you would like to revert to a specific commit, GIT reset is a better option for you.
  1. Open Terminal app and navigate to your local folder with the repo you would like to revert changes
  2. Selet the branch you would like revert by running git checkout <branch-name-here>
  3. Run git log --oneline to see all of the commits
  4. On the left each commit has a hash ID, find the commit you would like to revert to and highlight and copy that ID to the clipboard.
  5. Run git revert --no-commit <commit-id> To revert a range of commits, use git revert --no-commit <start-range_commit-hash-id>..<end-range_commit-hash-id>
  6. Then run git revert --continue
  7. A revert msg window will appear, update the message and follow the instratctions to save/exit the window.
  8. In your git history you should now see the revert commit and changes reverted from your local GIT repo
  9. Run git push origin to upload the latest changes to github.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD4bxjhbpZOBtIfOI4VM8TxmpuR8KPIi4IN/HcVUFYnJ9kLMa1tttVrm45U4YS24jFHLWhighNYe2lVaTL5p6RIXwN7GXp3sb8uHjQ5qzsOCRLOE/MZ4E+oVfabdNpj7Aqq/v7Tascn0kkYl/Ub/JFem8LiH3iBpj0hmTOtdTQNHnO9NXPa6mbAG+O5WQPgjGBaQKfmYYnGQQ+RCvuogrm6MgX0KLo8NGjE8fWLOVsyKRQcvXSWNKEYp0Epez0NI4tA/OojB/tdegQ1Ef3nMi1T+zGDmge0gB4V8ncvAAUNkjE+thcVmd7Vv/LlpA4CGS7is3D5BAEgUbGH6T8sDh3T dompascal@DESKTOP-SBLH9V5
#!/bin/sh
export HELM_VERSION=v2.9.1
export HELM_INSTALL_DIR=~/usr/local/bin
wget https://kubernetes-helm.storage.googleapis.com/helm-$HELM_VERSION-linux-arm.tar.gz -P ~/downloads
tar xvzf ~/downloads/helm-$HELM_VERSION-linux-arm.tar.gz -C ~/downloads
sudo mv ~/downloads/linux-arm/helm $HELM_INSTALL_DIR
rm -rf ~/downloads/linux-arm
helm list
helm init --tiller-image elafargue/tiller:arm2.9.0 --tiller-namespace kube-system --service-account tiller
#!/bin/sh
echo "Update"
sudo apt-get update
echo "Update completed"
echo "mDNS Setup"
sudo apt-get install avahi-daemon
echo "mDNS installed"
@dompascal
dompascal / wp-acf-conditional-img.php
Created March 14, 2014 23:10
WP - ACF conditional image
<?php if(get_field('header_slideshow_image')) { ?>
<?php $image = wp_get_attachment_image_src(get_field('header_slideshow_image'), 'header-slideshow'); ?>
<img class="rsImg" src="<?php echo $image[0]; ?>" alt="" />
<?php } elseif(get_field('blog_thumbnail')) { ?>
<?php $image = wp_get_attachment_image_src(get_field('blog_thumbnail'), 'header-slideshow'); ?>
<img class="rsImg" src="<?php echo $image[0]; ?>" alt="" />
<?php } else { ?>
<img class="rsImg" src="<?php bloginfo('template_url'); ?>/css/img/slideshow-placeholder.jpg" alt="Image Unavailable" />
<?php } ?>
@dompascal
dompascal / js-add-seq-number.js
Created March 11, 2014 20:17
JS - Add sequential numbers to each item
// add sequential numbers to each list item
$("ol#boutiques li .city-and-state").each(function (i) {
i = i+1;
if(i < 10) i = "0"+i;
$(this).prepend('<span class="number">' +i+ '.</span>');
});
@dompascal
dompascal / aws-s3-read-all-bucket-policy.md
Created February 26, 2014 16:45
AWS - S3 Read all bucket policy

{ "Version": "2008-10-17", "Statement": [ { "Sid": "AllowPublicRead", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject",