Skip to content

Instantly share code, notes, and snippets.

@kennonb
kennonb / toggle_bluetooth_devices.applescript
Last active January 13, 2017 03:10
Toggle Bluetooth Devices
set btchoice to BT_Choice()
on BT_Choice()
-- Change the object listing of devices to the names of your personal Bluetooth devices
display dialog "Choose the device of your choice" with title "Selecting Device" buttons {"Keyboard", "Powerbeats 3", "Magic Trackpad"} default button "Powerbeats 3"
set Ndialogresult to the result
set DNameSel to button returned of Ndialogresult
display dialog "Whether to Connect or Disconnect the Device" with title "Handling Bluetooth" buttons {"Connect", "Disconnect", "Cancel"} default button "Connect"
@kennonb
kennonb / bernard_transaction_parameters.php
Created May 25, 2015 16:03
Bernard Transaction Parameters
$bernardParameters = [
'PartnerID' => 'Bernard ID',
'TotalTransactionAmount' => (float) "10.00",
'TransactionDate' => $this->carbon->now()->toIso8601String(),
'Channel' => '3-Internet',
'BatchType' => 'Web Import',
// This changes based on the type of card used
'BatchCategory' => 'Internet - Visa/MC',
@kennonb
kennonb / iis_pfx_to_apache_key.sh
Created April 15, 2015 02:50
Convert IIS .pfx to Apache .key
# Export the private key file from the pfx file
openssl pkcs12 -in filename.pfx -nocerts -out key.pem
# Export the certificate file from the pfx file
openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem
# This removes the passphrase from the private key so Apache won't
# prompt you for your passphase when it starts
openssl rsa -in key.pem -out server.key
@kennonb
kennonb / ApiDispatcher.php
Created February 19, 2015 14:48
Api Dispatcher Middleware Idea
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Routing\Route;
class ApiDispatcher
{
@kennonb
kennonb / Homestead.yaml
Last active October 20, 2016 03:36
Example Homestead.yaml + after.sh + /etc/hosts
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
mariadb: true
authorize: ~/.ssh/id_rsa.pub
keys:
@kennonb
kennonb / composer.json
Last active August 29, 2015 14:06
Sample composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.3.*",
"illuminate/html": "4.3.*@dev",
"lucadegasperi/oauth2-server-laravel": "3.0.*",
"cartalyst/sentinel": "1.0.*",
@kennonb
kennonb / symlink_sites_home_folder
Created June 10, 2014 16:06
Symlink ~/Sites to another Volume
@kennonb
kennonb / mdutil_indexing
Created June 10, 2014 16:04
Enable/Disable Spotlight Index
mdutil -i on <Volume Path>
@kennonb
kennonb / change_bind_address.sh
Created February 7, 2014 22:54
Allow external access to MySQL from Vagrant
# sudo nano /etc/mysql/my.cnf change:
bind-address = 0.0.0.0
@kennonb
kennonb / os-x-defaults-new-install
Created June 27, 2013 21:09
OS X Defaults (New Install)
# No delay on Dock display.
defaults write com.apple.Dock autohide-delay -float 0
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Disable the “Are you sure you want to open this application?” dialog