Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Looking for work in the Seattle, WA or remote areas. https://brianjking.io

Brian J King brianjking

💭
Looking for work in the Seattle, WA or remote areas. https://brianjking.io
View GitHub Profile
@mrkdevelopment
mrkdevelopment / In your social icons file
Last active May 14, 2020
Divi social icons extension
View In your social icons file
<?php if ( 'on' === et_get_option( 'divi_show_linkedin_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-linkedin">
<a href="<?php echo esc_url( et_get_option( 'divi_linkedin_url', '#' ) ); ?>" class="icon">
<span><?php esc_html_e( 'Linked In', 'Divi' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( 'on' === et_get_option( 'divi_show_youtube_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-youtube">
@KinnaT
KinnaT / sliders-functional-clean.php
Last active May 3, 2016
Functional selectable sliders as page meta option, uncommented version - accounts for the Revolution Slider and Smart Slider 3 plugins, trivial to add support for more plugins
View sliders-functional-clean.php
<?php
// content.php
$config = array(
'title' => __('General Options', 'theme_admin'),
'group_id' => 'general',
'context' => 'normal',
'priority' => 'low',
'types' => array( 'page' )
);
$options = array(
View GitGutter.sublime-settings
// This would go in $sublime_dir/Packages/User/GitGutter.sublime-settings
{
"live_mode": false,
"focus_change_mode": false
}
View fetch_mailchimp_data.sh
#!/bin/bash
MC_API_KEY="apikey:YOUR_KEY"
MC_LIST_ID="YOUR LIST ID"
# don't forget to update usN to your own MailChimp data center ID
TOTAL_ITEMS=`curl --silent --request GET --url "https://usN.api.mailchimp.com/3.0/lists/$MC_LIST_ID/members?fields=total_items" --user $MC_API_KEY | jq -r ".total_items"`
CHUNK_SIZE=1000
echo "id,email_address,status,avg_open_rate,avg_click_rate,timestamp_signup,last_changed,member_rating" > mailchimp_list.csv
echo "action,timestamp,url,type,campaign_id,title,parent_campaign,subscriber_id" > mailchimp_list_activity.csv
@brianjking
brianjking / speedtest-ifttt.sh
Created Mar 8, 2016 — forked from aallan/speedtest-ifttt.sh
Modified version of Henrik Bengtsson's speedtest-cli code which will dispatch the test results to the IFTTT Maker Channel.
View speedtest-ifttt.sh
#!/usr/bin/env bash
###########################################################################
# Originally written by: Henrik Bengtsson, 2014
# https://github.com/HenrikBengtsson/speedtest-cli-extras
# Modified to use IFTTT by: Alasdair Allan, 2015
# License: GPL (>= 2.1) [http://www.gnu.org/licenses/gpl.html]
###########################################################################
# Character for separating values
# (commas are not safe, because some servers return speeds with commas)
@gnachman
gnachman / iterm.scpt
Last active Mar 31, 2019
Replace /Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/iterm.scpt with this.
View iterm.scpt
set itermRunning to (application "iTerm" is running)
set scriptPath to quoted form of POSIX path of ((path to me as text) & "::" & "start.sh")
set user_shell to do shell script "dscl /Search -read /Users/$USER UserShell | awk '{print $2}'"
tell application "iTerm"
activate
if not (exists window 1) or (itermRunning = false) then
reopen
end if
@adeekshith
adeekshith / .git-commit-template.txt
Last active Nov 20, 2020 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
View .git-commit-template.txt
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
View acme-reload.rb
#!/usr/bin/env ruby1.9.3
require 'pg'
require 'optparse'
require 'tmpdir'
require 'shellwords'
require 'socket'
require 'json'
require 'digest'
require 'public_suffix'
View _setting-up-rpi-web-server.md

Setting up a RaspberryPi Web Server with NginX

WARNING!

I started this guide as I was building my web server but it was never finished. Nonetheless there's some valuable info for anyone starting a web server from scratch.

Steps

  1. [download offline raspbian][0]
  2. follow instructions for [no screen install of raspbian][1]
  3. setup [static ip address][2], reserve in router, and update hosts file on remote computer
  4. follow [secure web server][7], [secure ssh best practices][3], setup [ssh-copy-id in mac][4]
@db
db / bulletproof-git-workflow.md
Last active Jul 6, 2017
bulletproof git workflow
View bulletproof-git-workflow.md

Bulletproof Git Workflow

start working

git checkout master
git pull
git checkout -b feature/my-work
# edit your files
You can’t perform that action at this time.