Skip to content

Instantly share code, notes, and snippets.

View cstrouse's full-sized avatar
💭
Bug Bounty

Casey Strouse cstrouse

💭
Bug Bounty
View GitHub Profile
version: '3.2'
services:
webserver:
image: phpstorm/php-73-apache-xdebug-26
ports:
- '80:80'
volumes:
- ./:/var/www/html
environment:
XDEBUG_CONFIG: remote_host=host.docker.internal
<?php
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.assemblyai.com/v2/transcript', [
'headers' => [
'authorization' => 'YOUR-API-TOKEN',
'content-type' => 'application/json'
],
\GuzzleHttp\RequestOptions::JSON => [
[Unit]
Description=Example
Wants=example.timer
[Service]
ExecStart=/usr/bin/node /home/casey/Projects/example/index.js
WorkingDirectory=/home/casey/Projects/example
[Install]
WantedBy=multi-user.target
@cstrouse
cstrouse / functions.php
Created November 21, 2019 19:48
If you're inserting Google Tag Manager's two code snippets into your Elementor site via hooks and the second one isn't showing up try this hook.
add_action('elementor/page_templates/header-footer/before_content', 'myprefix_google_tag_manager_no_js');
function myprefix_google_tag_manager_no_js() {
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
}
@cstrouse
cstrouse / .vimrc
Last active November 10, 2019 23:50
Misc vim settings that I find useful when doing dev work on my Chromebook (with chromebrew)
" pretty-print json in buffer
nmap =j :%!python -m json.tool<CR>
function print_filters_for( $hook = '' ) {
global $wp_filter;
if( empty( $hook ) || !isset( $wp_filter[$hook] ) )
return;
print '<pre>';
print_r( $wp_filter[$hook] );
print '</pre>';
}
apt update
apt upgrade -y
apt install -y git gnupg2
useradd -s /bin/bash -d /home/deploy -m -G sudo deploy
passwd deploy
# do the rest as deploy
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
@cstrouse
cstrouse / lowes.py
Created November 8, 2019 04:04
scrape pricing data for a given Lowe's Item SKU and store number.
import lxml.etree,json
import requests
s = requests.Session()
s.headers.update({'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36'})
resp = s.get('https://www.lowes.com/pd/search/4005755/pricing/2421')
js = lxml.etree.HTML(resp.content).find('./head/script[2]').text
@cstrouse
cstrouse / install-picolisp.sh
Created November 4, 2019 20:22
Compile and install picolisp onto a Samsung Chromebook Plus V1 (requires Chromebrew for build tools)
#!/bin/bash
cd $(mktemp -d)
wget -q https://software-lab.de/picoLisp.tgz
tar xzf picoLisp.tgz
cd picoLisp/src
make DYNAMIC-CC-FLAGS=-fPIC M32=
@cstrouse
cstrouse / ck4up-generate-conf.rb
Last active November 4, 2019 00:02
Generates a template for you to work with using the ck4up utility from CRUX
require 'tmpdir'
#
# Generates a template for you to work with using the ck4up utility from CRUX
# https://crux.nu/Wiki/WorkingWithCk4up
#
workspace = Dir.mktmpdir
Dir.chdir(workspace)