Skip to content

Instantly share code, notes, and snippets.

View ctalkington's full-sized avatar

Chris Talkington ctalkington

View GitHub Profile
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active April 17, 2024 12:35
Using Git with Subversion Mirroring for WordPress Plugin Development
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@awarecan
awarecan / lambda_function.py
Last active March 14, 2024 19:26
Alexa Smart Home Skill Adapter for Home Assistant
"""
Copyright 2019 Jason Hu <awaregit at gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@padolsey
padolsey / makeInterpolator.js
Last active February 21, 2024 11:50
Dead simple straight-up performant interpolation
/**
* Outputs a new function with interpolated object property values.
* Use like so:
* var fn = makeInterpolator('some/url/{param1}/{param2}');
* fn({ param1: 123, param2: 456 }); // => 'some/url/123/456'
*/
var makeInterpolator = (function() {
var rc = {
'\n': '\\n', '\"': '\\\"',
'\u2028': '\\u2028', '\u2029': '\\u2029'
@bdraco
bdraco / core_integration_pr
Last active December 1, 2023 07:26 — forked from ludeeus/core_integration_pr
Install HA Core PR as custom component
#!/bin/bash
# curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d domain -p 12345
while getopts d:p: flag
do
case "${flag}" in
d) domain="${OPTARG}";;
p) pull_request="${OPTARG}";;
esac
done
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@gbot
gbot / wp-xmlrpc-jail.local
Last active July 26, 2023 17:07
Fail2Ban WordPress XMLRPC Jail and Filter. Notes: log path is set for Plesk v12.x. Change this to appropriate path for your set up. Only works if WordPress is installed in webroot, edit the Filter failregex if installed in sub-directory.
[wp-xmlrpc]
enabled = true
filter = wp-xmlrpc
action = iptables-multiport[name=wp-xmlrpc, port="http,https"]
logpath = /var/www/vhosts/system/*/logs/*access*log
/var/log/httpd/*access_log
bantime = 86400
maxretry = 0
@shanebp
shanebp / bp-profile-tab-and-subnav.php
Last active June 28, 2023 18:11
BuddyPress add profile tab and subnav
function add_animal_tabs() {
global $bp;
bp_core_new_nav_item( array(
'name' => 'Animals',
'slug' => 'animals',
'parent_url' => $bp->displayed_user->domain,
'parent_slug' => $bp->profile->slug,
'screen_function' => 'animals_screen',
'position' => 200,
@mfkp
mfkp / index.html
Created December 17, 2011 01:39
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">