Skip to content

Instantly share code, notes, and snippets.

View mavencode01's full-sized avatar
🏠
Working from home

Philip K. Adetiloye mavencode01

🏠
Working from home
View GitHub Profile
@mavencode01
mavencode01 / angularjs-providers-explained.md
Created October 3, 2015 15:17 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@mavencode01
mavencode01 / ViedeoView.java
Last active August 29, 2015 14:27
VideoView extends TextureView with rotation support
package com.mavencode.modules.chatwindow.widget;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.SurfaceTexture;
import android.media.AudioManager;
import android.net.Uri;
@mavencode01
mavencode01 / purge-cloudstack.sh
Last active August 29, 2015 14:26 — forked from CrackerJackMack/purge-cloudstack.sh
PEW PEW reset cloudstack as a fresh install
/etc/init.d/cloud-management stop
mysql -ppassword -e 'drop database cloud'
mysql -ppassword -e 'drop database cloud_usage'
cloud-setup-databases cloud:password@localhost --deploy-as=root:password
rm -rf /var/log/cloud/management/*
cloud-setup-management
/etc/init.d/cloud-management start

Install, Setup, and Test Spark and Cassandra on Mac OS X

This Gist assumes you already followed the instructions to install Cassandra, created a keyspace and table, and added some data.

Install Apache Spark

brew install apache-spark
package com.mycompany.ssl;
import java.net.Socket;
import java.security.Principal;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.annotation.Nullable;
import javax.net.ssl.X509KeyManager;
// Copyright 2014 BrightTag, Inc. All rights reserved.
package com.brighttag.storm.utils;
import static com.google.common.base.Preconditions.checkArgument;
/**
* Computes the parallelism for a particular topology and machine configuration.
*
* @author codyaray
* @since 4/21/2014
@mavencode01
mavencode01 / style.css
Created April 7, 2015 01:11
Responsive CSS tables - Reference http://codepen.io/anon/pen/QwPVNW
body {
font-family: arial;
}
table {
border: 1px solid #ccc;
width: 100%;
margin:0;
padding:0;
border-collapse: collapse;
// Set up the UIRefreshControl.
self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self
action:@selector(refreshInvoked:forState:)
forControlEvents:UIControlEventValueChanged];
// Create a UITableViewController so we can use a UIRefreshControl.
UITableViewController *tvc = [[UITableViewController alloc] initWithStyle:self.tableView.style];
tvc.tableView = self.tableView;
tvc.refreshControl = self.refreshControl;
@mavencode01
mavencode01 / vertx-maven-goal
Created February 20, 2015 16:12
Run vertx maven
vertx:runMod