Skip to content

Instantly share code, notes, and snippets.

Avatar

Rasheed Abdul-Aziz squeedee

View GitHub Profile
@squeedee
squeedee / can_debug.bash
Created Sep 24, 2021
Code as a script but with re-entrant/debug access to functions
View can_debug.bash
#!/usr/bin/env bash
# usages:
# As a script:
# $ ./can_debug.bash
# > you are Rasheed Abdul-Aziz
# As a library of functions:
# $ source can_debug.bash
# $ say_my_name
# > usage: say_my_name <your-name-here>
View metadata.yml
{
"release": {
"version": "0.3.52",
"release_type": "Developer Release",
"release_date": "2019-2-13",
"eula_slug": "pivotal_beta_eula",
"description": "The ISV CI team uses these files to test behaviour,\nboth manually and in our enemy tests\n",
"availability": "Admins Only",
"release_notes_url": "https://github.com/cf-platform-eng/test-pas-tiles/app-only"
},
View gist:da68695120c9a139a240fa85c358d2ab
class LayoutRenderer
include ActionView::Helpers
include Webpacker::Helper
def csp_meta_tag;
end
end
namespace :webpacker do
@squeedee
squeedee / Rakefile
Created Mar 8, 2020
Webpack dev server
View Rakefile
namespace :server do
desc "Start the webpack dev server"
task :webpack do
system "./bin/webpack-dev-server"
end
desc "Start the rails dev server"
task :rails do
system "rails server"
end
@squeedee
squeedee / Capybara.md
Last active Mar 5, 2020 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet
View Capybara.md

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@squeedee
squeedee / print-target-inputs.sh
Created Aug 8, 2019
Tool to print the evaluated inputs to a Makefile target - great for testing your makefile `$(shell find ....)` commands
View print-target-inputs.sh
target="${1:-you forgot a target}"
echo "Target is ${target}"
make -np ${target} | grep -e "^${target}:"
@squeedee
squeedee / add-github-ssh-key.sh
Last active Mar 6, 2019
Script to add your github ssh key to any github requests. Great for concourse tasks with private golang modules.
View add-github-ssh-key.sh
#!/usr/bin/env bash
if [[ -z "${GITHUB_KEY}" ]] ; then
echo "GITHUB_KEY not defined"
exit 1
fi
mkdir -p $HOME/.ssh
chmod 700 $HOME/.ssh
echo "${GITHUB_KEY}" > $HOME/.ssh/id_github
@squeedee
squeedee / comments.py
Last active Feb 21, 2018
Refactoring with extract method Vs Comments
View comments.py
def pivnet_products(product_pattern=""):
"""
gets all pivnet products that match exactly with the product pattern, or partial matches
when there are no exact matches.
"""
url = 'https://network.pivotal.io/api/v2/products'
all_products = json.load(pivnet_get(url))
products = [p for p in all_products["products"] if product_pattern == p["name"]]
if len(products) == 0:
products = [p for p in all_products["products"] if product_pattern in p["name"]]
@squeedee
squeedee / md5.py
Last active Feb 14, 2018
Md5 things in python
View md5.py
def execute_build():
os.chdir("./dashboard2")
subprocess.call(["npm", "run", "build"])
os.chdir("../")
def save_srcs_md5(md5, path):
file = open(path, "w")
file.write(md5)
file.close()
@squeedee
squeedee / example.jsx
Created Jan 17, 2018
Simple props based react router
View example.jsx
<Router authorized={true}>
<Match fn={(props) => (props.authorized)}>
<Environments/>
</Match>
<Match fn={(props) => (!props.authorized)}>
<SlackPage/>
</Match>
</Router>