Skip to content

Instantly share code, notes, and snippets.

View evansekeful's full-sized avatar
🤠
building stuff to solve my own annoyances

Ellie Evans evansekeful

🤠
building stuff to solve my own annoyances
View GitHub Profile
@evansekeful
evansekeful / msdax
Last active August 30, 2023 19:18
modeling_dax_patterns
// Standard Fact Table Pattern
EVALUATE
SUMMARIZECOLUMNS(
// Define dimensions for DAX query at lowest level of granularity needed
'Table1'[Field1],
'Table2'[Field2],
// Apply filters to remove any unneeded data
FILTER( -- single filter example
@evansekeful
evansekeful / amazon-ec2-fullsetup-linux1.md
Created January 21, 2019 16:13
Quick Commands for Setting Up AWS EC2 Website Server - Amazon Linux v1

This is an abbreviated guide based on Amazon's tutorials and piecemealed advice from around the web to set-up a standard website server instance with EC2. For complete explanations regarding Amazon LAMP, visit this link: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

Security Inbound Rules:

HTTP 80 0.0.0.0/0
HTTPS 443 0.0.0.0/0
Custom TCP Rule 1024 - 1048 0.0.0.0/0
Custom TCP Rule 20 - 21 0.0.0.0/0

# Find duplicate SKUs in a table
SELECT [SKU], COUNT([SKU]) AS NumOccurences
FROM [DB].[dbo].[TABLE]
Group by [SKU]
HAVING ( Count([SKU]) > 1)
# Find duplicate SKUs in a table, return with other columns
SELECT *
FROM [DB].[dbo].[TABLE]
WHERE [SKU] IN
@evansekeful
evansekeful / amazon-ec2-fullsetup.md
Last active January 21, 2019 16:09
Quick Commands for Setting Up AWS EC2 Website Server - Amazon Linux2

This is an abbreviated guide based on Amazon's tutorials and piecemealed advice from around the web to set-up a standard website server instance with EC2. For complete explanations regarding Amazon LAMP, visit this link: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html

Security Inbound Rules:

HTTP 80 0.0.0.0/0
HTTPS 443 0.0.0.0/0
Custom TCP Rule 1024 - 1048 0.0.0.0/0
Custom TCP Rule 20 - 21 0.0.0.0/0

@evansekeful
evansekeful / excel_formulas_ref.txt
Last active October 15, 2022 03:19
Excel Formulas
# Toggle absolute reference
F4
# Strikethrough hotkey
Ctrl + 5
# Check if value is in a sheet/column A, return bool
=IF(ISERROR(VLOOKUP(A2,'Sheet1'!A:A, 1, FALSE)),FALSE,TRUE )
@evansekeful
evansekeful / wp-write-breadcrumb.php
Last active October 3, 2017 14:21
Wordpress Write Breadcrumb
/**
* http://www.bloggingtips.com/2009/02/22/create-a-breadcrumb-trail/
**/
function write_breadcrumb() {
$pid = $post->ID;
$trail = '<a href="'.get_site_url().'/">'. __('Home', 'textdomain') .'</a>';
if (is_front_page()) {
// do nothing
}
elseif (is_page()) {
@evansekeful
evansekeful / wc-remove-related-products.php
Created June 27, 2017 17:26
WooCommerce Remove Related Products
@evansekeful
evansekeful / remove-core-updates.php
Created June 27, 2017 17:24
Wordpress Remove Core Updates Function
function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates');
add_filter('pre_site_transient_update_plugins','remove_core_updates');
add_filter('pre_site_transient_update_themes','remove_core_updates');