Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
@Teino1978-Corp
Teino1978-Corp / new jekyll blog post
Created November 7, 2015 17:08
New Jekyll Blog Post
# Create a new Jekyll blog post
function blogpost() {
today=$(date +%Y-%m-%d);
touch $today-$@".md"
}

Yosemite Upgrade Tweaks

I switched to OS X 10.10 Yosemite a couple weeks after the Beta release. While it's been surprising stable, there are a few things I've had to tweak for development. Compiling a list here.

Homebrew was dead [fixed]

I followed this: http://jcvangent.com/fixing-homebrew-os-x-10-10-yosemite

Ruby/RVM/Ruby Gems was fishy [fixed..enough]

I think this has something to do with the system update to Ruby 2.0.

@Teino1978-Corp
Teino1978-Corp / Node + npm
Created November 7, 2015 16:54
OS X Yosemite Setup
# Install Node
$ brew install node
$ npm install
$ npm install -g async
$ npm install -g pg
$ npm install -g db-migrate
$ npm install -g grunt
$ npm install -g gulp
@Teino1978-Corp
Teino1978-Corp / apache-tomcat-railo-multiweb.md
Created November 7, 2015 09:13
Updated instructions on setting up multiple web instances of Railo 4 with Tomcat 7.0.42 and Apache on Mac OS 10.9.

Tomcat

In the Tomcat folder create a railo/ folder and copy in the contents of the unzipped Railo JARs ZIP file (or from the WEB-INF/lib/ folder of the unzipped Railo WAR file). In the Tomcat conf/ folder, edit catalina.properties and find the common.loader class path. We're going to add the Railo JARs to the common class path so that every web application can have Railo CFML pages. The new common.loader definition should look like this (all on one line, no spaces): common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/railo,${catalina.home}/railo/*.jar

Note: embedding Railo directly in Tomcat like this means that you will end up with a generated WEB-INF/ folder in each webroot, containing some Railo files (about 2MB).

Unless you're going to use the default web applications that come with Tomcat, this is a good time to empty the Tomcat webapps/ folder. You could create a default/ folder in the Tomcat folder and move everything from webapps/ to default/

Tomcat 6 under secured Nginx?

In Big Blue Button Tomcat 6 is used under Nginx.

Tomcat documentation for "SSL - How to" in "SSL and Tomcat" section, clames that:
"It is important to note that configuring Tomcat to take advantage of secure sockets is usually only necessary when running it as a stand-alone web server. When running Tomcat primarily as a Servlet/JSP container behind another web server, such as Apache or Microsoft IIS, it is usually necessary to configure the primary web server to handle the SSL connections from users. Typically, this server will negotiate all SSL-related functionality, then pass on any requests destined for the Tomcat container only after decrypting those requests. Likewise, Tomcat will return cleartext responses, that will be encrypted before being returned to the user's browser. In this environment, Tomcat knows that communications between the primary web server and the client are taking place over a secure conn

@Teino1978-Corp
Teino1978-Corp / Utils.m
Created November 7, 2015 08:07
Get CGSize from NSString
+ (CGSize)getNSStringSize:(NSString *)string withFont:(UIFont *)font{
NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:font,NSFontAttributeName, nil];
return [[[NSAttributedString alloc] initWithString:string attributes:attributes] size];
}
@Teino1978-Corp
Teino1978-Corp / gist:94678274c31b63cb9851
Created November 7, 2015 07:46
Cocoa Touch request for address book access
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, NULL);
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) {
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
// First time access has been granted, add the contact
});
}
else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized)
{
// add the contact
@Teino1978-Corp
Teino1978-Corp / MS Perks & Benefits.md
Created November 7, 2015 03:57
Summary of any and all perks when working with Microsoft.

##Perks of Microsoft

####Salary

####Health and Wellness Care

  • Medical and hospitalization: Two choices for medical insurance. Both with no premium but different deductibles.
    • The two choices on medical plans are a high-deductible health plan (Microsoft puts a chunk of money into the Health Savings Account for you, which covers most of the deductible) and an HMO.
  • With the HMO, you pay basically nothing as long as you only go to Group Health doctors. With the high-deductible plan, you're covered under the local Blue Cross provider which means you can go to just about any doctor in the country. For
@Teino1978-Corp
Teino1978-Corp / EventLog.cs
Created November 6, 2015 22:31
Future Event Log
class EventLog {
class Event {
DateTime when;
// can track when event started as well, lets you loop back through and find failed tasks
Key key;
}
Event[] events;
int nextPush = 0;
int nextPop = 0;
@Teino1978-Corp
Teino1978-Corp / fx_current_setup.adoc
Created November 6, 2015 22:17
Currency Exchange - Current Setup

Currency Exchange - Current Setup

Market Outline

  • $5.3 trillion turnover every day across 192 currencies, with over 40% global trading involving European currencies

  • for banks, financial institutions and most businesses, trading stops every weekend from 20:15 GMT on Sunday until 22:00 GMT Friday

  • extreme market concentration: the top 4 institutions (Deutsche Bank, Barclays Capital, UBS & Citi) account for around 46% of all foreign exchange transactions. Throw in JPMorgan, HSBC, RBS, Credit Suisse, Goldman Sachs and Morgan Stanley (so, just 10 closely networked institutions) and you have 77% of all currency trading.

  • large spreads between buy and sell prices across currency pairs. Almost all businesses and financial institutions, exchanging into another currency then back, will lose at least 1% of value. For consumers, losses