Skip to content

Instantly share code, notes, and snippets.

View NegarMirgati's full-sized avatar
⚔️
The game is on

Negar NegarMirgati

⚔️
The game is on
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
From KERAS package
Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
"""
@NegarMirgati
NegarMirgati / token_auth.py
Created October 11, 2020 14:14 — forked from rluts/token_auth.py
Token authorization middleware for Django Channels 2
from channels.auth import AuthMiddlewareStack
from rest_framework.authtoken.models import Token
from django.contrib.auth.models import AnonymousUser
from django.db import close_old_connections
class TokenAuthMiddleware:
"""
Token authorization middleware for Django Channels 2
"""
@NegarMirgati
NegarMirgati / token_auth.py
Created October 11, 2020 14:14 — forked from rluts/token_auth.py
Token authorization middleware for Django Channels 2
from channels.auth import AuthMiddlewareStack
from rest_framework.authtoken.models import Token
from django.contrib.auth.models import AnonymousUser
from django.db import close_old_connections
class TokenAuthMiddleware:
"""
Token authorization middleware for Django Channels 2
"""
const fs = require('fs')
const path = require('path')
if(process.argv.length <= 2) {
console.log("Usage: " + __filename + " path/to/directory")
process.exit(-1);
}
const entryPath = process.argv[2];
fs.readdir(entryPath, function(err, items) {
items.forEach(function(item) {