Skip to content

Instantly share code, notes, and snippets.

@LL782
LL782 / next-prev-sibling.php
Last active April 8, 2022 23:07
Next and Prev Page Siblings - Wordpress
<?php
function getId($page) { return $page->ID; }
$ancestors = get_post_ancestors( $post->ID );
$parent = ($ancestors) ? $ancestors[0] : null;
if ($parent) :
$siblingIds = array_map( "getId", get_pages('child_of='. $parent .'&sort_column=menu_order&sort_order=asc') );
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active July 10, 2024 14:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@natelandau
natelandau / .bash_profile
Last active June 13, 2024 18:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@plasticbrain
plasticbrain / gulpfile.js
Last active February 13, 2024 14:31
gulp.js task to deploy code to remote servers
/*******************************************************************************
* Description:
*
* Gulp file to push changes to remote servers (eg: staging/production)
*
* Usage:
*
* gulp deploy --target
*
* Examples:
@amol9
amol9 / Security checks
Last active February 21, 2019 10:07
Check your online security.
<1>
Usage: breach_check.sh <account> [detail]
e.g.
> ./breach_check.sh tom@facebook.com
found 6 breaches
BinWeevils
Edmodo
Evony
OnlinerSpambot
@dangerous
dangerous / gist:98b2b158b5625f837b8bdce43a965b3f
Created October 14, 2021 07:09
First 10000 reddit users sourced from karmalb
1. kn0thing
2. spez
3. third
4. fifth
5. fourth
6. agentorange
7. chickenlittle
8. erzengel
9. fizzypop
10. madmax2
@wise-io
wise-io / InstallZeroTier.ps1
Last active April 22, 2024 09:14
Installs Latest ZeroTier One Client
<#
.SYNOPSIS
Installs ZeroTier
.DESCRIPTION
Install ZeroTier and join/configure ZeroTier network
.EXAMPLE
./ios-InstallZeroTier.ps1
.NOTES
This script will install PowerShell 7 if it is not present.
A UAC prompt will appear during install if -UI is used.