Skip to content

Instantly share code, notes, and snippets.

aklowther / get_ip-alfred3
Created November 12, 2018 15:43
Original script link is below. I modified it to show both my IPv4 and IPv6 external addresses on separate lines
LOCAL=$(ifconfig | grep -A 1 "en" | grep broadcast | cut -d " " -f 2 | tr "\\n" " ")
EXTERNAL6=$(curl --silent -6)
EXTERNAL4=$(curl --silent -4)
<?xml version="1.0"?>
<item uid="localip" arg="$LOCAL">
<title>Local IP: $LOCAL</title>
<subtitle>Press Enter to paste, or Cmd+C to copy</subtitle>

Keybase proof

I hereby claim:

  • I am aklowther on github.
  • I am aklowther ( on keybase.
  • I have a public key ASCMRUamjhvezGjKnWd8RHGa9_xy_hL55Kv5DfsqRZvW-go

To claim this, I am signing this object:

aklowther / Log Define
Last active December 16, 2015 08:19
Replace NSLog for more info to where the printout is. Add to project .pch file to use in the whole project w/o needed imports
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
# define DLog(...)
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#ifdef DEBUG
# define ULog(fmt, ...) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
# define ULog(...)
aklowther / cutsomButton.qml
Created February 19, 2013 16:15
BB10 Cascades Button Replacement
import bb.cascades 1.0
Container {
id: topLevelContainer
property alias buttonImage: buttonImage
property alias containerToChangeButtonBackground: buttonContainer.background
property bool buttonPressed: false
leftPadding: 2.0
topPadding: 2.0
rightPadding: 2.0