Skip to content

Instantly share code, notes, and snippets.

View regnerjr's full-sized avatar

John Regner regnerjr

View GitHub Profile
(defun john-convert ()
"Takes Hex dump from Wireshark, looks for the ack offset \"3032\"
Then finds the byte offset requested, and converts that hex to binary"
(interactive)
(beginning-of-line)
(search-forward "3032")
(newline)
(while (not (eolp))
(forward-char 2)(princ " " (current-buffer)))
(beginning-of-line)
@regnerjr
regnerjr / SVN log human calendar
Created June 3, 2014 14:33
A shell function for retrieving the svn log for a given human readable time frame, i.e. 2 weeks ago, 1 hour ago. Great for when you get back from lunch and want to see what your co-workers have been upto.
s () {
svn log -r {$(date --date="$*" +%FT%T)}:HEAD -v -g
}
@regnerjr
regnerjr / bfunct
Created June 13, 2014 14:47
Shown declared bash_functions
declare -f | grep -E '^[a-zA-Z]'
@regnerjr
regnerjr / bfunctdef
Created June 13, 2014 14:50
View the details of a defined bash function
bfunctdef () {
#show the definition of a bash_function
# Note the quoting, so the input variable is expanded.
declare -f | awk '/^'$1'/,/^}/'
}
history | awk '{ print $2 }' | awk '{ a[$0]++ } END { for(key in a) print a[key], key }' | sort -rn | head -n 100
//
// ViewController.swift
// Quiz
//
// Created by John Regner on 7/26/14.
// Copyright (c) 2014 In Your Dreams Software. All rights reserved.
//
import UIKit
@regnerjr
regnerjr / Chapter2
Last active August 29, 2015 14:04
iOS Programming: Chapter 2 in Swift
//
// BNRItem.swift
// Created by John Regner on 7/28/14.
//
import Foundation
extension Array {
func randomItem() -> T {
let random = Int(arc4random()) % self.count
@regnerjr
regnerjr / Chapter 4
Created August 15, 2014 02:38
Chapter 4 - BNR iOS Programming - Swift
//
// ViewController.swift
// WhereAmI
//
// Created by John Regner on 8/13/14.
// Copyright (c) 2014 In Your Dreams Software. All rights reserved.
//
import UIKit
import CoreLocation
//
// ViewController.swift
// WhereAmI
//
// Created by John Regner on 8/13/14.
// Copyright (c) 2014 In Your Dreams Software. All rights reserved.
//
import UIKit
import CoreLocation
@regnerjr
regnerjr / Chapter4-WithChallenges
Created August 27, 2014 00:55
Chapter 4 - BNR iOS Programming - Swift
//
// ViewController.swift
// WhereAmI
//
// Created by John Regner on 8/13/14.
// Copyright (c) 2014 In Your Dreams Software. All rights reserved.
//
import UIKit
import CoreLocation