Skip to content

Instantly share code, notes, and snippets.

View walee-balogun's full-sized avatar

Adewale Balogun walee-balogun

View GitHub Profile
@walee-balogun
walee-balogun / node.js multer upload dynamic folder
Created August 9, 2017 20:25 — forked from JotaroX/node.js multer upload dynamic folder
Node.js multer upload dynamic folder support jQuery file upload
var moment = require('moment'),
path = require('path'),
crypto = require('crypto'),
multer = require('multer');
module.exports = function (app) {
app.post('/upload', multer({
storage: multer.diskStorage({
@walee-balogun
walee-balogun / Node_AWS_Linux.md
Created August 22, 2017 12:28 — forked from nrollr/Node_AWS_Linux.md
Install Node.js on Amazon Linux (EC2)

##Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

@walee-balogun
walee-balogun / README.md
Created August 23, 2017 05:48 — forked from aronwoost/README.md
How to install node.js and CouchDB on a Google Compute Engine instance

#How to install node.js and CouchDB on a Google Compute Engine instance

Start and ssh into instance

Make sure you have a Google Compute engine account, have a project created and the gcutil command line tool installed.

Since want to ssh without the gcutil tool, you need to a your ssh key to the instance in addition to the already existing google_compute_engine key (used for gcutil).

@walee-balogun
walee-balogun / filter.js
Created November 12, 2017 11:33 — forked from thewarpaint/filter.js
Angular filter to convert numbers to thousand suffixes (1234 > 1.2k)
// Based on http://stackoverflow.com/questions/1571374/converting-values-to-unit-prefixes-in-jsp-page.
// The inner filter function can be used standalone.
angular.module('Utils')
.filter('thousandSuffix', function () {
return function (input, decimals) {
var exp, rounded,
suffixes = ['k', 'M', 'G', 'T', 'P', 'E'];
if(window.isNaN(input)) {
@walee-balogun
walee-balogun / filter.js
Created November 12, 2017 11:33 — forked from ptldhaval/filter.js
Angular filter to convert numbers to thousand suffixes (1234 > 1.2k)
/*Initial Referance taken from https://gist.github.com/thewarpaint/889690aeb21a8dfd7aba and modified as per the requirement.*/
angular.module('Utils',[]).filter('isoCurrencyWithK', ["$filter", "iso4217", function ($filter, iso4217) {
return function (amount, fraction, currencyCode) {
var exp = 0, rounded, currency, nagative, suffixes = ['','K', 'M', 'G', 'T', 'P', 'E'];
//set decimal amount. Default 0
var fractionSize = fraction === void 0 ? 0 : fraction;
//check if the amount is more than 1000
//if yes, set suffix for the amount
if(amount >= 1000 || amount < -1000 ) {
@walee-balogun
walee-balogun / upgrade_openssh_on_os_10.9.x.md
Created February 7, 2018 15:41 — forked from jmenbo/upgrade_openssh_on_os_10.9.x.md
Manually upgrade OpenSSH on OS 10.9.x

Manually upgrade OpenSSH on OS 10.9.x

NOTE: Installation and testing was done on a clean Mavericks (OS 10.9) installation

Install Brew:

Install Homebrew prereqs:

xcode-select --install

Install Homebrew

public class ColoredSnackBar {
private static final int red = 0xfff44336;
private static final int green = 0xff4caf50;
private static final int blue = 0xff2195f3;
private static final int orange = 0xffffc107;
private static View getSnackBarLayout(Snackbar snackbar) {
if (snackbar != null) {
@walee-balogun
walee-balogun / DividerItemDecoration.java
Created July 5, 2018 01:11 — forked from alexfu/DividerItemDecoration.java
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@walee-balogun
walee-balogun / Readme.md
Created July 5, 2018 01:11 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@walee-balogun
walee-balogun / Animation.md
Created August 18, 2018 22:51 — forked from JeOam/Animation.md
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath

1. The Layer Tree

Core Animation's original name is Layer Kit

Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.

In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.

There are four hierarchies, each performing a different role:

  • view hierarchy
  • layer tree