Skip to content

Instantly share code, notes, and snippets.

View mbijon's full-sized avatar

Mike Bijon mbijon

View GitHub Profile
Encoded Traversal Strings:
mbijon / probabalistic-patterened-blur.rb
Created May 8, 2021 00:30
Example of complex blur using Image Magick + mini_magick
# Copyright Ognjen Regoje, 2021
require 'mini_magick'
INPUT_FILE = "input-1-lg.jpg"
image =
size ={|x| x}
mbijon / webrick-ssl.rb
Created April 22, 2021 16:14 — forked from demisx/webrick-ssl.rb
Configure Webrick Server as SSL
#!/usr/bin/env ruby
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'
require 'webrick/https'
module Rails
class Server < ::Rack::Server
def default_options
mbijon / git.nginx.conf
Created March 15, 2021 22:07
Serving git over "smart HTTP" >> nginx config for git-http-backend
# From:
# you should have other ssl configuration elsewhere...
server {
listen 443 ssl http2;
charset utf-8;
# where cgit is installed to
# -*- coding: utf-8 -*-
Created on Fri Dec 21 18:59:49 2018
@author: Nhan Tran
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
mbijon /
Created June 2, 2020 19:08 — forked from jiggneshhgohel/
Doorkeeper (with JWT token) Server and Client applications configuration, references etc

Provider(aka Server)-side configuration, routes, controllers etc


Doorkeeper 4.2.6

Devise 4.2.0


mbijon /
Created May 31, 2020 08:40
AdaBound AMSBound for Keras
# coding: utf-8
Based on Luo et al. (2019). Adaptive Gradient Methods with Dynamic Bound of Learning Rate. In Proc. of ICLR 2019.
from tensorflow import keras
class AdaBound(keras.optimizers.Optimizer):
def __init__(self, lr=0.001, beta1=0.9, beta2=0.999, final_lr=0.1, gamma=1e-3, epsilon=None, weight_decay=0, amsbound=False, **kwargs):
super(AdaBound, self).__init__(**kwargs)
with keras.backend.name_scope(self.__class__.__name__):
mbijon /
Created May 13, 2020 05:56 — forked from karpathy/
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
mbijon /
Created February 7, 2020 01:19 — forked from rahul286/
rbenv ubuntu server cheatsheet
## ubuntu server with bash shell
git clone ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone ~/.rbenv/plugins/ruby-build
## verify
type rbenv
mbijon /
Created October 20, 2019 07:16 — forked from duhaime/
Simple ASCII Encoding
import numpy as np
from scipy.misc import imread
from skimage.transform import resize
import matplotlib.pyplot as plt
import json, glob
#%matplotlib inline
def path_to_string(path):
'''Given a path to an image, return a string of that image as ascii'''