Skip to content

Instantly share code, notes, and snippets.

Yoni Jah yonjah

Block or report user

Report or block yonjah

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
View native-middleware.js
async function chargeCreate ({ amount, source, description, currency }) {
//do some stuff before the function
await someService.doAsyncStuff(amount, currency, description);
try {
const charge = await stripe.charges.create.apply(stripe.charges, arguments);
//do some stuff after the function
myTraceService.log(`New charge ${charge.amount}`);
return charge;
} catch (e) {
// do something with the error if you want to
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@yonjah
yonjah / gist:5082855
Last active Feb 1, 2018
Blocking DDOS bots with JavaScript for fun and profit! Or how easy it is to break the current protection methods and how to make it better.
View gist:5082855
TL;DR - jump to the challenge at the end
====ON BLOCKING EVIL BOTS=====
On a resent job interview I had for "Incapsula" a few days ago I was put to the challenge to break
their bot protection mechanism. Apparently node.js is not that common among bot writes and most bots
are not able to run javascript.
The challenge had two parts -
1. find what the code does.
2. implement a bot that will break the code without using js.
3. think how to make this code unbreakable
You can’t perform that action at this time.