Skip to content

Instantly share code, notes, and snippets.

View ScottJWalter's full-sized avatar
🔮
Particle. Wave. It's all data.

Scott Walter ScottJWalter

🔮
Particle. Wave. It's all data.
View GitHub Profile
@ScottJWalter
ScottJWalter / whatthefork.py
Last active March 23, 2020 19:44 — forked from Hellowlol/whatthefork
Check all forked branches if they are ahead of master/self open in browser
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Dirty script to check if any forks in ahead of master and open that branch commitlist
Warning: Uses alot of api calls
"""
import requests
from requests.auth import HTTPBasicAuth
@ScottJWalter
ScottJWalter / composer-private-package-github-token.md
Created March 17, 2020 20:19 — forked from jeffersonmartin/composer-private-package-github-token.md
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

@ScottJWalter
ScottJWalter / automatic-version-numbers.md
Created March 12, 2020 22:59 — forked from sg-s/automatic-version-numbers.md
Automatic version numbers of your git repository using git hooks

Put this in a file called pre-commit in .git/hooks/

#!/bin/sh
# To enable this hook, rename this file to "pre-commit".

git log master --pretty=oneline | wc -l > build_number
git add build_number
@ScottJWalter
ScottJWalter / parse_dotenv.bash
Created January 11, 2020 20:20 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@ScottJWalter
ScottJWalter / git-tag-delete-local-and-remote.sh
Created October 22, 2019 19:46 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@ScottJWalter
ScottJWalter / wds-hello-world.php
Created October 9, 2019 21:41 — forked from Oceas/wds-hello-world.php
WDS WP-CLI 101 Complete
<?php
/*
Plugin Name: WDS Hello World
Plugin URI: https://webdevstudios.com/
Description: Teaching the basics of WP-CLI
Author: Web Dev Studios
Version: 1.0.0
Author URI: https://webdevstudios.com/
*/
class WDS_CLI {
@ScottJWalter
ScottJWalter / index.js
Created August 18, 2019 03:26 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@ScottJWalter
ScottJWalter / PHP_Codesniffer_notes.md
Last active August 3, 2019 18:01 — forked from GaryJones/notes.md
Add PHPCS + WPCS to Sublime Text 3

Install PHP_CodeSniffer (PHPCS) via git

You can use the .phar for PHPCS, but it's easier to pull the repo down from git to then choose what version to use.

cd ~
mkdir -p code
cd code
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs
@ScottJWalter
ScottJWalter / fabfile.py
Last active January 22, 2024 10:50 — forked from joshkehn/fabfile.py
Fabric api to upgrade or freeze pip packages
from fabric.api import local
import pip
def freeze ():
local("pip freeze > requirements.txt")
local("git add requirements.txt")
local("git commit -v")
def upgrade ():
for dist in pip.get_installed_distributions():
@ScottJWalter
ScottJWalter / gitclone-nonempty.sh
Created March 20, 2019 23:30 — forked from damondouglas/gitclone-nonempty.sh
Git clone into non-empty directory
git clone --no-checkout [email protected]:<path>.git tmp
mv tmp/.git .
rm -rf tmp
git reset --hard HEAD