Skip to content

Instantly share code, notes, and snippets.

View elmaedesistemas's full-sized avatar
💻
Wait... I'm check this line of code...

Deiby Mejia Ruiz elmaedesistemas

💻
Wait... I'm check this line of code...
View GitHub Profile
@animir
animir / user.controller.ts
Last active August 10, 2024 15:12
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;
@pablokbs
pablokbs / docker-compose-macvlan.yaml
Created December 18, 2018 13:34
Ejemplo de docker-compose corriendo rtorrent y samba, usando el driver macvlan
## docker-compose usando driver macvlan
## by PeladoNerd https://youtu.be/eoFxMaeB9H4
version: "2"
services:
samba:
image: dperson/samba:rpi
restart: always
@gayanhewa
gayanhewa / index.php
Created August 8, 2017 04:41
Visa Checkout Sample
<html>
<head>
<script type="text/javascript">
function createCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
@plutoegg
plutoegg / TetherToken.sol
Last active April 17, 2025 10:25
TetherToken.sol - Tether.to USD
pragma solidity ^0.4.11;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
@rodrwan
rodrwan / binary-tree.js
Last active November 6, 2024 23:28
Implementación árbol binario en JavaScript
class Node {
constructor (value) {
this.value = value
this.right = null
this.left = null
}
}
class Tree {
constructor () {