Skip to content

Instantly share code, notes, and snippets.

View jenkoian's full-sized avatar
👨‍💻
Works on my machine

Ian Jenkins jenkoian

👨‍💻
Works on my machine
View GitHub Profile
@spicecadet
spicecadet / 1. Codeship Deployment
Last active October 5, 2020 21:40
This is my deployment script for pushing from Github to a WP Engine WordPress install. The scripts below can be added as custom scripts to Codeship's Deployment Pipelines.
# Environment Variables
#INSTALL=
#EMAIL=
#ENVIRONMENT="production"
#SERVICE=
#ASSERTIBLE_CODE=
@mjangda
mjangda / ngrok-and-jetpack.md
Last active February 7, 2023 07:57
How to connect ngrok to your local WordPress environment (props @DanReyLop)

How to develop with Jetpack locally with ngrok

To connect Jetpack in your local installation, you'll need a way for WP.com servers to reach your server. That can be done in a number of different ways:

  • You can open your router's ports and use your public IP
  • You can use some kind of Dynamic DNS provider.

But these options fall short of ngrok, which is a "localhost tunnel". It basically allows the Internet to hit a local port on your machine without worrying about ports or IPs.

As long as ngrok is running, Jetpack / WP.com will be able to communicate with your local site. This will allow remote modules like Site Search and Manage to work.

@geerlingguy
geerlingguy / ansible-role-test.sh
Last active December 14, 2024 17:13
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@chartjes
chartjes / cycle-list.php
Created March 27, 2017 20:32
My PHP script for creating a Twitter list where people cycle on and off it based on 30 days of interaction
<?php
require "vendor/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
// You can get all these via https://dev.twitter.com/
$consumer_key = "";
$consumer_secret = "";
$access_token = "";
$access_token_secret = "";
$user_id = 0; // Twitter user ID
@vinothkannans
vinothkannans / git-merge.md
Last active March 1, 2024 02:20
Syncing a fork or clone without history of remote commits
  • First fork or clone your remote git project
  • Delete existing history and commits by deleting .git folder
  • Add remote git project as upstream
  • Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.
git fetch upstream
  • Check out your local master branch.
git checkout master
@yosukehasumi
yosukehasumi / git-auto-deploy.md
Last active July 25, 2023 20:07
Setting Up Git-Auto-Deploy on Digital Ocean

Install software-properties-common

sudo apt-get install software-properties-common

Add Repo

sudo add-apt-repository ppa:olipo186/git-auto-deploy
@tomsleeter
tomsleeter / wc-avatax-functions.php
Created June 28, 2016 22:05
Add woocommerce avatax tax code to Woo product REST API response
//expose avatax code to rest api
add_filter( 'woocommerce_api_product_response', 'wc_expose_product_tax_code' );
function wc_expose_product_tax_code($product) {
$tax_code = get_post_meta($product['id'], '_wc_avatax_code', TRUE);
$product['wc_avatax_code'] = $tax_code;
return $product;
}
@leglesslizard
leglesslizard / Upgrade Jenkins
Created April 18, 2016 13:41
Upgrade Jenkins on Ubuntu AWS with tomcat
$ cd /opt/bitnami
## Stop the server
$ ./ctlscript.sh stop
## Copy your previous .war file in case you need to restore it
$ cp apache-tomcat/webapps/jenkins.war apps/jenkins/jenkins.war.bak
## Remove jenkins all files to force Tomcat to deploy the new jenkins.war file
$ rm -r apache-tomcat/webapps/jenkins
$ rm -r apache-tomcat/webapps/jenkins.war
@marcj
marcj / do-it.sh
Last active April 12, 2020 08:47
OSX PhpStorm, better performance - more FPS using OpenGL
cp /Applications/PhpStorm.app/Contents/bin/phpstorm.vmoptions ~/Library/Preferences/WebIde*
echo -ne "\n-Dawt.useSystemAAFontSettings=lcd\n-Dawt.java2d.opengl=true" >> ~/Library/Preferences/WebIde*/phpstorm.vmoptions
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active August 17, 2024 06:33
An Open Letter to Developers Everywhere (About Cryptography)