Skip to content

Instantly share code, notes, and snippets.

View briantully's full-sized avatar

Brian Tully briantully

View GitHub Profile
@briantully
briantully / blockpeers.sh
Created December 29, 2016 23:25 — forked from jult/blockpeers.sh
blocking p2p peer snoopers and evil corp (for Tixati IP filter and such)
#!/bin/sh
# This script runs every other night at 04:56 CET on a webserver I maintain
# Resulting file is always at: https://jult.net/block.txt ( or https://jult.net/block.txt.gz )
# but DON'T open that URL in a browser..
# Best use the much smaller, stripped of BS; https://jult.net/bloc.txt
# For use in Tixati IP filter: https://jult.net/bloc.txt.gz
# And finally a txt file with just the bold IP-ranges: https://jult.net/bl.txt (or https://jult.net/bl.txt.gz )
# Download open block-lists, unpack, filter:
@briantully
briantully / chrome-vacuum.sh
Last active July 1, 2017 05:50 — forked from michaelhood/gist:e703700cb960546670dba2ddf1281f15
Chrome sqlite vacuum on OsX
#!/bin/sh
DIRECTORY="$HOME/Library/Application Support/Google/Chrome/"
cd "${DIRECTORY}"
CUR_DIR=`pwd`
echo "CURRENT DIRECTORY IS: ${CUR_DIR}"
select
`Time Period`,
round(avg(num), 1) `Average Number of Orders`
from (
select
date_format(date_sub(o.created_at, interval 8 hour), "%l:00 - %l:59 %p PST") `Time Period`,
count(*) num,
date_format(date_sub(o.created_at, interval 8 hour), "%H") sort
from sales_flat_order o
where o.created_at > '2016-01-01 00:00:00'
@briantully
briantully / magento.conf
Created July 30, 2017 01:17 — forked from Tom-Alexander/magento.conf
nginx config for magneto
server {
listen 8080;
root /Users/user/Sites/magento.co.nz;
server_name magento.dev "~magento\.(.*)\.xip\.io$";
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
proxy_connect_timeout 90;
proxy_send_timeout 180;
proxy_read_timeout 180;
@briantully
briantully / slack-dark-theme.css
Created August 18, 2017 20:31 — forked from gkostov/slack-dark-theme.css
Dark theme for slack
#msgs_scroller_div::-webkit-scrollbar-track, #client_body::before, .client_container,
#search_terms, #client_body, #footer, ts-message, .channel_header, ts-jumper ts-jumper-container,
ts-jumper input[type="text"],
.supports_custom_scrollbar:not(.slim_scrollbar) #col_channels:hover #channels_scroller::-webkit-scrollbar-track{
background: #333 !important;
}
#client_body::before {
border-bottom: 1px solid #1a2129 !important;
}
@briantully
briantully / slack2html.php
Created February 13, 2018 20:56 — forked from jordanmkoncz/slack2html.php
slack2html
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@briantully
briantully / magento-orders_per_minute.sql
Last active July 19, 2018 21:03 — forked from CajuCLC/magento-orders_per_minute.sql
magento-orders_per_minute.sql
SELECT
# Change the interval based on UTC to show on specific timezone
date_format(date_sub(o.created_at, INTERVAL 7 HOUR), "%l:%i %p") `Time in PST`,
count(*) OPM
FROM sales_flat_order o
# Time from the DB - last 3 hours
WHERE o.created_at > DATE_SUB(NOW(), INTERVAL 3 HOUR)
AND o.created_at < NOW()
AND o.store_id='1374'
GROUP BY HOUR(o.created_at),MINUTE(o.created_at)
@briantully
briantully / memcache.php
Created July 26, 2018 21:15
Acquia D8 Memcache Sample Configuration
/**
* @file
* Example implementation of ACSF post-settings-php hook.
*
* @see https://docs.acquia.com/site-factory/tiers/paas/workflow/hooks
*/
// The path to this file should be docroot/factory-hooks/post-settings-php/memcache.php
// Use ACSF internal settings site flag to apply memcache settings.
@briantully
briantully / jsonapi.vcl
Created August 1, 2018 23:51 — forked from swichers/jsonapi.vcl
Varnish VCL for checking authorization against a different page and then forcing a cached response.
vcl 4.0;
# !!Important!! Do not use this if your authenticated response can vary
# between users or roles.
# Note: This is only useful if the following things are true:
# * Access to the jsonapi endpoints is restricted to authorized users only.
# * jsonapi request results will be the same for all authorized users. No
# customized or filtered results based on role or other access checks.
@briantully
briantully / git-overlap.sh
Created August 13, 2018 14:08 — forked from swichers/gist:bbc28deabd76ad25f09c186b09c128a8
Checks for shared file modifications within a commit range
#!/usr/bin/env bash
#
# Checks the configured commit range to determine which commits modify files
# that were modified in an earlier commit.
#
# Example:
# Commit 1:
# foo.txt
# bar.txt
# Commit 2: