Skip to content

Instantly share code, notes, and snippets.

View ZeroPivot's full-sized avatar
💭
Working on Managed Partitioned Array for DragonRuby

ArityWolf ZeroPivot

💭
Working on Managed Partitioned Array for DragonRuby
View GitHub Profile
def fnumero(string:)
words=string.split("")
numero=words.inject(0){|result, element| result.ord + element.ord}
while (numero.to_s.split("").length > 1) do
break if numero % 11==0
numero=numero.to_s.split("").inject(0){|result, element| result.to_i + element.to_i}
end
# Script to fix a spotify problem (where abba.json prevents the browse page from loading)
# Written in Ruby by ArityWolf/Potential Difference (11/08/2018)
PATH_TO_SPOTIFY="C:/Users/[windows_username]/AppData/Roaming/Spotify/"
PATH_TO_ABBA="C:/Users/[windows username]/AppData/Local/Spotify/Users/[spotify username]/abba.json"
if (File.exist? PATH_TO_ABBA)
File.delete(PATH_TO_ABBA)
end
@ZeroPivot
ZeroPivot / imageRangeDetect.rb
Last active November 15, 2018 23:53
Detect an image based on its width and height being in between a width range ( like [x..y] ) and a height range.
#Ruby v2.5.3
#gem install fastimage
require "fastimage"
# Note: assumes MIN_* < MAX_*
#Constants#############
WIDTH=0
HEIGHT=1
################
@ZeroPivot
ZeroPivot / nginx.conf
Created November 16, 2019 16:59 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@ZeroPivot
ZeroPivot / shh.rb
Created November 28, 2020 21:57 — forked from robinsloan/shh.rb
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
require "big"
# Step a name from the arity to the finished string, and get the count of that (Crystal Language Version)
# 2020-12-12
print "What is the name? "
end_test = gets.to_s.chomp # Get the user input, which is the name of whomever you want to compute
puts
DEBUG = true
MODULO_DEBUG_RATE = 1_000_000
# Step a name from the arity to the finished string, and get the count of that
# 2020-12-12
print "What is the name? "
end_test = gets.chomp
puts
DEBUG = true
MODULO_DEBUG = 1_000_000
def string_arity(string)
@ZeroPivot
ZeroPivot / nginx.conf
Created December 21, 2020 18:45 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
def sprite_fetch_arr(args, sprite_name)
sprite_coordinates = []
args.outputs.sprites.each_with_index do |sprite, index|
if (sprite.sprite_name == sprite_name)
sprite_coordinates = args.outputs.sprites[index].xywh_arr
args.outputs.labels << LabelUse.new(600, 600, "#{sprite_coordinates}", 2, 0, "fonts/AritySpeak.tif", 0, 0, 255, 255)
break
end
end
@ZeroPivot
ZeroPivot / nginx.conf
Last active January 3, 2021 12:21
Configuration for use with Puma and Nginx
user root;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
#multi_accept on;
}