Skip to content

Instantly share code, notes, and snippets.

View wilsolutions's full-sized avatar
😀

Wils wilsolutions

😀
View GitHub Profile
@wilsolutions
wilsolutions / ios
Last active April 6, 2016 23:42
General Objective-C snippets to work around some iOS issues.
// Drawing a dotted line
float width = kBoundsWidth - 90;
CAShapeLayer *shapelayer = [CAShapeLayer layer];
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(-30, 30)];
[path addLineToPoint:CGPointMake(width, 30)];
UIColor *fill = [UIColor lightGrayColor];
shapelayer.strokeStart = 0.0;
shapelayer.strokeColor = fill.CGColor;
shapelayer.lineWidth = 0.5;
@wilsolutions
wilsolutions / gist:96e3ae1310ccae86d344
Created January 29, 2015 17:48
XCTest + CoreData = EXC_BAD_ACCESS(code=EXC_i386_GPFLT)
<unknown>:0: error: -[apiTests testExample] : failed: caught "NSInvalidArgumentException", "*** -[NSURL initFileURLWithPath:]: nil string parameter"
(
0 CoreFoundation 0x007321e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x004ac8e5 objc_exception_throw + 44
2 CoreFoundation 0x00731fbb +[NSException raise:format:] + 139
3 Foundation 0x000c592b -[NSURL(NSURL) initFileURLWithPath:] + 123
4 Foundation 0x000c57fd +[NSURL(NSURL) fileURLWithPath:] + 67
5 apiTests 0x04010023 -[DatabaseManager managedObjectModel] + 291
6 apiTests 0x040102b7 -[DatabaseManager persistentStoreCoordinator] + 503
7 apiTests 0x0400f538 -[DatabaseManager setupContexts] + 312
+ (void)pingReachabilityInternal
{
BOOL ignoresAdHocWiFi = NO;
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000)
struct sockaddr_in6 ipAddress;
bzero(&ipAddress, sizeof(ipAddress));
ipAddress.sin6_len = sizeof(ipAddress);
ipAddress.sin6_family = AF_INET6;
#else
struct sockaddr_in ipAddress;
(function() {
'use strict';
angular.module('starter')
.directive('applyFocus', function($timeout) {
return {
link: function(scope, element, attrs) {
$timeout(function() {
element[0].style.color = "blue";
mazon Web Services: Enterprise Security
Ethical Hacking: Website and Web Application Testing
CISSP Cert Prep: 4 Communication and Network Security
Ethical Hacking: Mobile Devices and Platforms
Ethical Hacking: Trojans and Backdoors
Ethical Hacking: Penetration Testing
CISSP Cert Prep: 3 Security Engineering
Cloud Computing: Cloud Security
Open Data: Unleashing Hidden Value
Ethical Hacking: Wireless Networks
// Test Android intent from command line
#adb shell am start -W -a android.intent.action.VIEW -d "http://domain.blah/" com.somedomain.appname
// Need to remember to pass a expression (fn) the watch or a full string path
vm.$onInit = function() {
$scope.$watch("$paymentInfoCtrl.cardModel.cardNumber", function(newValue, oldValue) {
console.log('oldValue: ' + oldValue + 'newValue: ' + newValue);
});
};
/* Style the elements (nothing interesting here) */
p{
font-size: 16px;
width: 420px;
margin: 20px auto 0;
text-align:center;
}
.container{
@wilsolutions
wilsolutions / # node - 2018-04-19_17-03-06.txt
Created April 19, 2018 22:00
node on macOS 10.13.3 - Homebrew build logs
Homebrew build logs for node on macOS 10.13.3
Build date: 2018-04-19 17:03:06
Fatal error
java.lang.RuntimeException
First seen version
20420002
File
ActivityThread.java
Exception message
java.lang.RuntimeException: Unable to resume activity {com.wsample.wsample/com.wsample.wsample.MainActivity}:
#!/bin/sh
: '
Requirements:
$ brew install imagemagick
Usage:
$ ./icon-tool iconPath destination
Where: