Skip to content

Instantly share code, notes, and snippets.

@KyleLeneau
KyleLeneau / .bash_profile
Created March 26, 2024 16:25
bash-dotfiles
source ~/.git_aliases
alias df="df -h"
alias ping="ping -c3"
alias :q="exit"
alias :wq="exit"
if [[ $(uname) = 'Darwin' ]]; then
if [[ -x `which brew` ]]; then alias updateos="brew update && brew upgrade && brew cleanup && softwareupdate -i -a" ;fi
@KyleLeneau
KyleLeneau / check-x86-bitcode-support.sh
Created April 10, 2018 15:41
Checks for required targets in static libraries and frameworks, also checks for Bitcode support for anything in the directory it's run from recursively.
#!/bin/bash
PATH=$(pwd)
REQUIRED_ARCHS="arm64 x86_64"
REPORT_FILE="${PATH}/x86-bitcode-support-report.txt"
function clean_report() {
/bin/rm -f "$REPORT_FILE"
}
@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`
#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)
//
// 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);
@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="your@email.com"
LOG_FILE="/var/log/httpd/access_log"
@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
using System;
using System.Text;
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Website
{
public class JsonNetResult : ActionResult
{