Skip to content

Instantly share code, notes, and snippets.

Tommie N. Carter, Jr., BSIT, MBA mingsai

Block or report user

Report or block mingsai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mingsai
mingsai / automator_script
Created Mar 23, 2014
Convert Chinese Characters to Pinyi
View automator_script
# Assumes you have rdef utility installed in /usr/local/bin
# rdef can be found here: https://github.com/mingsai/rdef
# See accompanying readme.txt for instructions to create MacOSX service
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/:
export PATH
LC_CTYPE=UTF-8
x=$1
for ((i=0;i<${#x};i++)); do rdef "${x:i:1}" | awk -F '\|' 'BEGIN {ORS=" "}{ gsub(/^ | +?/, "", $2); if (length($2) > 0) print $2 ; exit}'; done
View PSPDFUIKitMainThreadGuard.m
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2013 Peter Steinberger. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
View PSPDFThreadSafeMutableDictionary.m
//
// PSPDFThreadSafeMutableDictionary.m
//
// Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@mingsai
mingsai / MNGTextViewHandler.swift
Created Jul 2, 2015
A textview delegate to catch and throw messages as needed by textview events
View MNGTextViewHandler.swift
//
// MNGTextViewHandler.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/18/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGTextFieldHandler.swift
Created Jul 2, 2015
A textfield delegate used to catch and throw messages related to textfield events
View MNGTextFieldHandler.swift
//
// MNGTextFieldHandler.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/18/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGCollectionViewHandler.swift
Created Jul 2, 2015
A delegate class to handle UICollectionView events
View MNGCollectionViewHandler.swift
//
// MNGCollectionViewHandler.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/21/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGApplicatioNExtensions.swift
Created Jul 2, 2015
Extensions to the UIApplication along with a convenient place to store global constants when needed
View MNGApplicatioNExtensions.swift
//
// MNGApplicationExtensions.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/22/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGAVAudioSessionExtensions.swift
Created Jul 2, 2015
An AVAudioSession delegate to manage audio session events and an extension to the AVAudioSession to manage convenient setup for various audio profiles
View MNGAVAudioSessionExtensions.swift
//
// MNGAVAudioSessionExtensions.swift
//
//
// Created by Tommie Carter on 6/30/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import AVFoundation
@mingsai
mingsai / MNGRecorderHandler.swift
Created Jul 3, 2015
A swift delegate for managing an AVAudioRecorder and it's related events.
View MNGRecorderHandler.swift
//
// MNGRecorderHandler.swift
//
//
// Created by Tommie Carter on 6/29/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import AVFoundation
@mingsai
mingsai / MNGLayerExtensions.swift
Last active Aug 29, 2015
A swift extension that allows one to use gradient colors on all UIControls and UIViews and subviews (e.g. UIButton, etc. pretty much anything on screen)
View MNGLayerExtensions.swift
//
// MNGLayerExtensions.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/21/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
// Sample usage: self.view.layer.configureGradientBackground(UIColor.purpleColor().CGColor, UIColor.blueColor().CGColor, UIColor.whiteColor().CGColor)
// Nota Bene: Function can be applied to any UIControl that also has a view.layer property. Resolves the issue of gradient not covering full area on rotation by resizing the layer to a square
You can’t perform that action at this time.