Skip to content

Instantly share code, notes, and snippets.

View scottconnerly's full-sized avatar

Scott Connerly scottconnerly

View GitHub Profile
@jeskew
jeskew / SnsBroadcaster.php
Last active July 28, 2020 19:14
Laravel broadcasting with SNS
<?php
use Aws\Sns\SnsClient;
use Illuminate\Contracts\Broadcasting\Broadcaster;
class SnsBroadcaster implements Broadcaster
{
/** @var SnsClient */
private $sns;
/** @var array */
@twksos
twksos / CiscoVPNConnection.scpt
Last active July 31, 2023 20:50
Cisco VPN connection auto connect AppleScript
-- Please set your vpn connection name and password here
set VPNName to "VPN name"
set VPNpassword to "VPN password"
tell application "System Events"
tell current location of network preferences
set VPNService to service VPNName
end tell
set isConnected to connected of current configuration of VPNService
PImage src;
int circleWidth = 13;
void setup() {
size(displayWidth, displayHeight);
background(0);
noStroke();
src = loadImage("src/UnionSta-KC Skyline.jpg");
//src.resize(width, height);
@rufhausen
rufhausen / homestead_extras.sh
Last active August 11, 2021 03:33
My script for adding some "extras" (LDAP, Oracle, MSSQL, Oh-My-Zsh, etc.) to a Laravel Homestead Vagrant VM.
#!/bin/bash
apt-get update
#Additional Packages
apt-get install -y cifs-utils winbind smbclient bindfs gvfs gvfs-bin keyutils unzip php5-ldap php5-mssql zsh
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
chsh vagrant -s /bin/zsh
@alanchrt
alanchrt / triangulate.js
Created January 22, 2014 20:08
Triangulation of three points and radii
var distancePoints = function(p1, p2) {
// Find the distance between two points
return Math.sqrt(Math.pow(p2[0] - p1[0], 2) + Math.pow(p2[1] - p1[1], 2));
};
var intersectCircles = function (c1, r1, c2, r2) {
// Find the points of intersection for two circles
// Based on: http://stackoverflow.com/a/3349134
var d = distancePoints(c1, c2);
if (d > r1 + r2) // Circles do not overlap
@jterry
jterry / admin_notice.php
Last active December 16, 2015 17:08
Simple WP function to insert admin notices and errors.
/**
* Include
* add_action('admin_notices', 'lm_admin_message');
* in your setup, then call
* lm_admin_message('error', 'the message, fool!'); or
* lm_admin_message('notice', 'the notice, fool!');
* to display the admin message.
*
* @param string|null $type Supports "error" and "notice" (or null if it's the setup hook call)
* @param string|null $message Body of your message (or null if it's the setup hook call)