Skip to content

Instantly share code, notes, and snippets.

View Themitchell's full-sized avatar

Andy Mitchell Themitchell

View GitHub Profile
@Themitchell
Themitchell / ooo.rb
Last active September 24, 2021 15:07
Object Oriented Programming Workshop
def sum(a, b)
return a + b
end
class Sum
attr_writer :a
def initialize(a, b)
@a = a
@b = b
end
@Themitchell
Themitchell / creating-self-signed-certificates.md
Created May 3, 2017 12:09
Creating Self Signed Certificates

Creating Self Signed Certificates for use with Node and Chrome

Creating the certificate files

  1. Generate a private key with open ssl.

    $ openssl genrsa -des3 -out /var/lib/ssl/self-signed.key 1024
  2. Generate a CSR (Certificate Signing Request).

@Themitchell
Themitchell / olly.html
Created September 2, 2016 08:33
olly.html
<!DOCTYPE html>
<!-- saved from url=(0145)https://www.crowdsurge.com/draft/olly-murs/splash/?utm_source=dan&utm_medium=referral&utm_term=testing&utm_content=tester&utm_campaign=dan%20test -->
<html class="wf-inactive"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Olly Murs</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="Find out when Olly Murs is next playing live. Get concert tickets for tour dates near you.">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@Themitchell
Themitchell / tracking.js
Last active September 2, 2016 08:18
tracking.js
//modal overlay funcion
$(document).ready(function (){
$('.utm-link').each(addUTMParams);
$('.utm-link').click(function (event) {
ga('send', 'event', $(event.target).attr('data-type'), 'click', getParameterByName('source') + ' / ' + getParameterByName('medium'), {
'transport': 'beacon'
});
});
@Themitchell
Themitchell / tracking.js
Created September 2, 2016 08:06
tracking.js
//modal overlay funcion
$(document).ready(function (){
$('.utm-link').each(addUTMParams);
$('.utm-link').click(function (event) {
event.preventDefault()
ga('send', 'event', $(event.target).attr('data-type'), 'click', getParameterByName('source') + ' / ' + getParameterByName('medium'), {
'transport': 'beacon',
@Themitchell
Themitchell / sk-vm-sync.sh
Created January 27, 2016 13:33
sk-vm-sync.sh
export DEV_VM_USERNAME=myusername
export DEV_VM_HOST=my.host.name
export DEV_VM_CODE_DIR=directory
sync() {
echo "Syncing $(basename $(pwd)) from $(pwd) to $DEV_VM_USERNAME@$DEV_VM_HOST:$DEV_VM_CODE_DIR/$(basename $(pwd))/"
rsync -avrx --delete --exclude=log --exclude=tmp --exclude=vendor/bundle --filter='P vendor/bundle' --exclude=.bundle --filter='P .bundle' --exclude=.git -e ssh . $DEV_VM_USERNAME@$DEV_VM_HOST:$DEV_VM_CODE_DIR/$(basename $(pwd))/
}
watch-sync() {
@Themitchell
Themitchell / serato_dj_lanuch_control_midi.xml
Created November 27, 2014 19:12
Serato DJ MIDI Mappings for Novation Launch Control
<midi app=" 1.7.2.4859">
<control channel="1" event_type="Control Change" control="114">
<userio event="click">
<sample_player_bank_select deck_set="Default" deck_id="0" slot_id="0">
<translation action_on="press" behaviour="static" static_value="Bank A"/>
</sample_player_bank_select>
</userio>
</control>
<control channel="1" event_type="Control Change" control="115">
@Themitchell
Themitchell / serato_dj_launchpad_midi_mapping.xml
Created November 8, 2014 10:02
Serato DJ MIDI Mappings for Novation Launchpad
<midi app="1.7.2.4139">
<control channel="1" event_type="Note On" control="0">
<userio event="click">
<auto_loop_specific_length deck_set="Default" deck_id="0" slot_id="5">
<translation action_on="any" behaviour="explicit"/>
</auto_loop_specific_length>
</userio>
<userio event="output">
@Themitchell
Themitchell / serato_dj_midi_map.xml
Created November 3, 2014 13:25
Serato DJ Midi Map XML (double midi light out trigger bug?)
<midi app="1.7.2.4139">
<control channel="1" event_type="Note On" control="0">
<userio event="click">
<auto_loop_specific_length deck_set="Default" deck_id="0" slot_id="5">
<translation action_on="any" behaviour="explicit"/>
</auto_loop_specific_length>
</userio>
<userio event="output">