objective-c Dynamic height inputAccessoryView in iOS8 // // KeyboardBarView.m // Buzzrd // // Created by Brian Mancini on 5/17/14. // Copyright (c) 2014 Brian Mancini. All rights reserved. // #import "KeyboardBarView.h" #import "ThemeManager.h" @interface KeyboardBarView() @property (strong, nonatomic) UIImageView *imageView; @property (strong, nonatomic) UIButton *mainButton; @property (nonatomic) bool
ios UITextField docked like iOS Messenger A while ago I was searching for code on how to create a textbar that is docked at the bottom of the screen and moves with the keyboard when the textbox is selected. Very similar behavior to what is in iOS Messenger. You can
mongodb Updating embedded documents in mongodb To update an embeded document in an array when using mongo you will use the positional selector. The positional selector, when used in conjunction with update has two rules the positional $ operator acts as a placeholder for the first element that matches the query
ios Using UIRefreshControl The UIRefreshControl provides a nice refresh control for a UITableViewController. It's fairly easy to setup and use programmatically. To get started we will initialize the control in the loadView method. It will look something like: -(void)loadView { self.refreshControl = [[UIRefreshControl alloc]init]; [self.
ios Set back button to empty string in iOS I unwillingly spent a bit of time this evening trying to make the back navigation button show up without text. There are many people that suggest setting the following in loadView or viewDidLoad self.navigationController.navigationBar.topItem.title = @""; This will work, but
ios iOS keyboard return navigate to next field In iOS, the keyboard has a variety of customizations that can be applied to make it look and perform how you want it to. Most of these can be found in the UITextInputTraits protocol. Because UITextField implements this protocol, you can easily change the
ios CLLocationManager Singleton Attempting to share location services across various controllres can lead to much duplicate code. If you're simply interested in receiving updates about the user's current location, building a central location for retrieving this information can be quite useful. In my app, I settled on
mongodb Mongoose and Q There are some gotchas to working with Mongoose and Q. Here are a few things I've found that you need to be aware of... Binding Attempting to directly invoke a mongoose function with ncall or napply won't work because it looses its function binding.
javascript Understanding exceptions in Promises Many articles exist on how promises work. This article attempts to explain error propgation when using promises. Lets start with a simple function that throws an exception. function boom() { throw 'BOOM!'; } What happens when we execute the boom function as a promise using
ios Programmatic navigation with iOS Navigation Controller Stack For programmatic navigation using the Navigation Controller methods below, you must be using a NavigationController. You can start a navigation stack by building a NavigationController and setting the RootViewController as the first UIViewController you wish to display. RoomsViewController *roomsViewController = [[RoomsViewController alloc]
nginx Force SSL in location with nginx If you want to enforce SSL on a particular path in your application, say an admin section, you can use nginx to automatically enforce SSL. In a previous article I went over how to configure SSL, now I'll show you can redirect part of
nginx Adding SSL to a site in nginx This will walk you through configuring SSL for a site in nginx on Ubuntu 12.04. Step 1: Create directory for SSL cd /etc/nginx sudo mkdir ssl cd ssl Step 2: Create the server's private key sudo openssl genrsa -out server.key 2048
nginx Limit nginx site to local access You can easily configure access to a server in nginx by adding to the configuration the following: ## site.listmill.com server { server_name site.listmill.com; ## Allow local users to connect allow 192.168.0.0/24; ## Deny everyone else deny all; ## Forward request
nginx nginx as a reverse proxy In a previous article I wrote about using Squid for performing reverse proxy services. The new hotness on the block for such activity is called nginx. Nginx is a great tool for performing host proxying and SSL proxying. I'm using it to sit in
squid Squid as a reverse proxy Say you want to run multiple hosts off a single IP address. The answer is what is known as a reverse proxy. The reverse proxy will forward requests to other servers and ports. Several reverse proxy services exist. I happeneded to be running Squid
c# C# Process Tree The usual System.Diagnostic.Process class does not contain a reference to the parent process. This can be problematic if you want to retrieve the full process tree for a specific process. This is a guide on how to build out a process tree
extjs ExtJS: Templating Applying Templates This article describes a few techniques for rendering templates. The simplest I have found is to use apply and call then call update for your component and pass in the HTML that apply provided to you. For example, in a panel, I
extjs ExtJS: component event from DOM click I needed to define a custom event in a view that was rending its contents with a template. The view was a simple panel that used templates to render a fairly complicated display. Part of this display was supposed to trigger actions. To do
ios Blocks in Objective-C This is a syntax cheatsheet for blocks in Objective-C. I happen to like blocks a lot, so here's what I've come across. For more detailed reference refer to the Block Programming Guide on Apple's Developer Documentation site. As a Method Argument Creating a block
ios Create singletons in Objective-C Here's how to create singletones in Objective-C: First the interface, declare a class method as such... @interface AppAPI : NSObject +(AppAPI *)instance; @end Then implement it accordingly... @implementation AppAPI -(id) init { self = [super init]; return self; } // instance singleton +(AppAPI *)instance { static AppAPI *instance = nil;
ios Create a static UITableView without Storyboards Creating UITableViews programmatically is quite easy once you get the hang of UITableViews and become familiar with the various methods in UITableViewDataSource and UITableViewDelegate. The downside is there is not much documentation on constructing them programmatically. Building static table views without the aide of
mongodb Add a new property to a document in MongoDB This is an example of adding a new property based on another collection. In this case, I have two collections users and posts and I need to add a new property to posts that I also added to users In this example, I have
c# JSON service with WPF This is a code overview for creating a WPF endpoint that sends and receives JSON data. Assemblies references System.ServiceModel System.Runtime.Serialization System.ServiceModel.Web Configure the endpoint You can configure in the web.config your service endpoing by doing the following: <
ruby Installing rails from source This guide will walk you through installing ruby, rails, and passenger with Apache onto an Ubuntu 12.04 machine. It should give you everything you need to get a site up and running. Prereqs Update apt-get You should always make sure things are kosher
extjs ExtJS change a grid's store on the fly You can change an ExtJS grid on the fly after it has loaded by using reconfigure method on the grid. This feature allows you to change the data store and adjust the columns. The problem I ran into was how to populate a grid