Skip to content

Instantly share code, notes, and snippets.

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

Yusuf Adeyemo Yusadolat

🏠
Working from home
View GitHub Profile
@Yusadolat
Yusadolat / user.controller.ts
Created June 13, 2023 11:14 — forked from animir/user.controller.ts
Nest.js prevent brute-force against authorisation example
import { Request, Response } from 'express';
import { Body, Controller, Post, Req, Res } from '@nestjs/common';
import { UserService } from './user.service';
import * as Redis from 'ioredis';
import { RateLimiterRedis } from 'rate-limiter-flexible';
const redisClient = new Redis({enableOfflineQueue: false});
const maxWrongAttemptsByIPperDay = 100;
const maxConsecutiveFailsByUsernameAndIP = 5;
@Yusadolat
Yusadolat / cloudWatchAlarmsToSlack.js
Created May 9, 2023 05:07 — forked from statico/cloudWatchAlarmsToSlack.js
Lambdas for Slack Notifications
const fetch = require('./fetch')
const RED = '#cd3131'
const YELLOW = '#e5e512'
const GREEN = '#05bc79'
const BLUE = '#2472c8'
exports.handler = async function(event, context) {
// Debugging
// console.log('event', JSON.stringify(event, null, 2))
@Yusadolat
Yusadolat / gist:8f8a10b71be629f86a200447a7d7bf0d
Created August 21, 2020 16:09 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Yusadolat
Yusadolat / cover-letter.md
Created July 17, 2019 22:02 — forked from ivoputzer/cover-letter.md
cover letter

Cover Letter

My name is Ivo and I am an Italian agile software developer who loves coding and solving problems in a simple yet creative fashion. During my years of web development I have grown a strong passion for fronted development which led me to a good understanding of its underlaying technologies. I love hacking the hell out of web apps and getting a grasp of cutting edge technologies in order to keep up with time and deliver the best user experience possible.

While user experience still plays a big role in what I enjoy doing, I've learnt how important it is to write stable yet maintainable and scalable backend solutions. Even though I started out with PHP, I soon naturally came closer to the NodeJS environment while still embracing more "elegant" technologies such as Ruby or Java either adopting frameworks or by implementing architectures from scratch.

I discovered the Agile Manifesto and eXtreme Programming back while joining XPeppers in 2013 and I’ve tried my best to apply either values and prin

#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")
@import 'https://fonts.googleapis.com/css?family=Open+Sans';
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
line-height: 1.75em;
@Yusadolat
Yusadolat / UdacityDownload.py
Created December 26, 2016 14:32 — forked from vinovator/UdacityDownload.py
Python program to download course content for multiple Udacity courses neatly arranged within a folder structure
# UdacityDownload.py
# Python 2.7.6
"""
Python script to download course content from udacity courses
- Creates folders as per course names
- Downloads all the zip files
- Extract content from zip file
- Finally delete the zip file
Multiple course content can be downloaded from list
@Yusadolat
Yusadolat / 1.json
Created August 27, 2016 10:53 — forked from SeanJA/1.json
a simple json file migration for the drupal 7 (maybe 6?) migrate module
{
"title": "this is a title",
"content": "this is a body",
"date": "2009-01-01",
"url":"http://oldsite.com/123/test",
"image": "test.jpg",
"id": 1
}
@Yusadolat
Yusadolat / DropZone.jsx
Created August 17, 2016 16:29 — forked from pizzarob/01_DropZone.jsx
HTML5 Drag and Drop React Component
import React, {PropTypes} from 'react';
import classNames from 'classnames';
class BatchDropZone extends React.Component {
static propTypes = {
// function that recieves an array of files
receiveFiles: PropTypes.func.isRequired,
@Yusadolat
Yusadolat / gist:80c548ecb3850ef2cb81978418dfa884
Created May 6, 2016 10:15 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array