Skip to content

Instantly share code, notes, and snippets.

//
// UIView+Additions.h
//
// Created by Kyle LeNeau on 7/30/10.
// Copyright 2010 KyleLeNeau.com. All rights reserved.
//
#import <Foundation/Foundation.h>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Web;
using System.Web.Mvc;
namespace Website
{
using System;
using System.Text;
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Website
{
public class JsonNetResult : ActionResult
{
@KyleLeneau
KyleLeneau / iOs_gitignore
Created December 26, 2011 03:40
.gitignore File for iOS
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/project.xcworkspace
/build
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
target/*
.DS_Store
@KyleLeneau
KyleLeneau / rss-subscribers.sh
Created September 25, 2012 23:14
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default).
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic.
# Required variables:
RSS_URI="/rss"
MAIL_TO="[email protected]"
LOG_FILE="/var/log/httpd/access_log"
//
// CGPathBevel.h
//
// Created by Aaron Hayman on 6/21/12.
// Copyright (c) 2012 FlexileSoft, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
void bevelPath(CGPathRef path, CGContextRef context, CGFloat bevelDepth, CGColorRef highlight, CGColorRef shadow, BOOL eofFill);
#import <SystemConfiguration/CaptiveNetwork.h>
- (id)checkNetworkSSID {
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
NSLog(@"Supported interfaces: %@", ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
NSLog(@"%@ => %@", ifnam, info);
if (info && [info count]) { break; }

Keybase proof

I hereby claim:

  • I am KyleLeNeau on github.
  • I am kylep (https://keybase.io/kylep) on keybase.
  • I have a public key whose fingerprint is EAE4 9B72 1D02 56FA 2001 350C 9E4C 04C5 DB01 048A

To claim this, I am signing this object:

@KyleLeneau
KyleLeneau / ExampleViewController.swift
Last active October 31, 2015 21:08
Quick implementation of a UITextView that supports placeholder text and cursor position just like UITextField
class ExampleViewController: UIViewController, UITextViewDelegate {
@IBOutlet var placeholderInput: UIPlaceHolderTextView! {
didSet {
placeholderInput.placeholder = "Your custom placeholder text here"
placeholderInput.placeholderColor = UIColor.redColor() // what ever color you want here too
placeholderInput.text = placeholderInput.placeholder
placeholderInput.textColor = placeholderInput.placeholderColor
placeholderInput.selectedTextRange = placeholderInput.textRangeFromPosition(placeholderInput.beginningOfDocument, toPosition: placeholderInput.beginningOfDocument)
@KyleLeneau
KyleLeneau / InspectAPK.sh
Created July 15, 2016 07:20 — forked from laomo/InspectAPK.sh
Inspect APK's info like package name, version code, version name, etcetera
#!/bin/bash
apk_file=$1
if [ -z $apk_file ]; then
apk_file_num=`ls *.apk | wc -l | tr -d ' '`
if [ $apk_file_num -gt 1 ]; then
echo "Ambiguous apk_files. Please enter one APK to inspect."
exit -1
fi
apk_file=`ls *.apk`