Rails 5.0.0.1
Doorkeeper 4.2.6
Devise 4.2.0
Gemfile
Encoded Traversal Strings: | |
../ | |
..\ | |
..\/ | |
%2e%2e%2f | |
%252e%252e%252f | |
%c0%ae%c0%ae%c0%af | |
%uff0e%uff0e%u2215 | |
%uff0e%uff0e%u2216 |
# Copyright Ognjen Regoje, 2021 | |
# https://ognjen.io/generating-more-interesting-image-previews-using-imagemagick/ | |
# | |
#### | |
require 'mini_magick' | |
INPUT_FILE = "input-1-lg.jpg" | |
image = MiniMagick::Image.open(INPUT_FILE) | |
size = image.dimensions.map{|x| x} |
#!/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 |
# From: https://gemini.nytpu.com/gemlog/2021-03-07.gmi | |
######## | |
# | |
# you should have other ssl configuration elsewhere... | |
server { | |
listen 443 ssl http2; | |
server_name git.nytpu.com; | |
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 |
# 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__): |
""" | |
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) |
## ubuntu server with bash shell | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
## verify | |
type rbenv |
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''' |