Skip to content

Instantly share code, notes, and snippets.

Excellence Ilesanmi lon-io

Block or report user

Report or block lon-io

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
lon-io /
Created Jul 15, 2019 — forked from NARKOZ/
MySQL backup shell script
# Shell script to backup MySQL database
# Set these variables
# Backup Dest directory
DEST="" # /home/username/backups/DB
lon-io / lazy-image.js
Created Jun 17, 2019 — forked from ianmcnally/lazy-image.js
Lazy image loading
View lazy-image.js
import React, { Component } from 'react'
import type { ElementRef } from 'react'
type Props = { src: string, alt: string }
type State = { source?: string }
export default class LazyImage extends Component<Props, State> {
state = {}
lon-io /
Created May 17, 2019 — forked from eladnava/
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
# Make sure to:
# 1) Name this file `` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x
# 7) Test it out via ./
lon-io / image-onload.jsx
Created Apr 11, 2019 — forked from shuhei/image-onload.jsx
img.onload and unit test in React
View image-onload.jsx
import * as React from 'react';
import { mount } from 'enzyme';
import sinon from 'sinon';
function isImageLoaded(img: HTMLImageElement) {
return img.complete && img.naturalHeight > 0;
type Props = {
src: string,
lon-io / cloudSettings
Last active Apr 18, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
lon-io / async-await-error-handling.js
Last active Feb 1, 2019
Async Await Error handling
View async-await-error-handling.js
const a = (cb) => {
.then((res) => console.log(res))
.catch(error => {
console.log('Error caught', error.message)
const b = async() => {
throw new Error('new error')
lon-io /
Created Dec 11, 2018 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


lon-io / .gitignore
Created Sep 16, 2018 — forked from jbergler/.gitignore
Acestream on Mac
lon-io / Node.js CORS
Created Aug 17, 2018 — forked from nilcolor/Node.js CORS
Node.js cross-origin POST. You should response for OPTIONS request first. Something like this.
View Node.js CORS
if (req.method === 'OPTIONS') {
var headers = {};
// IE8 does not allow domains to be specified, just the *
// headers["Access-Control-Allow-Origin"] = req.headers.origin;
headers["Access-Control-Allow-Origin"] = "*";
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS";
headers["Access-Control-Allow-Credentials"] = false;
headers["Access-Control-Max-Age"] = '86400'; // 24 hours
headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept";
lon-io /
Created Aug 8, 2018 — forked from iwazaru/
Setup a self-signed SSL certificate with Nginx (server and browser)

1. Configure server: Nginx

Create the certificate:

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

Create a strong Diffie-Hellman group:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
You can’t perform that action at this time.