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
# Common configuration.
AllCops:
TargetRubyVersion: 3.0
NewCops: enable
SuggestExtensions: true
RubyInterpreters:
- ruby
- macruby
- rake
@amirrajan
amirrajan / main.rb
Created September 15, 2019 23:24
Vertical Platformer Written in DragonRuby Game Toolkit
class VerticalPlatformer
gtk_args
def inputs
args.inputs
end
def s
state.vertical_platformer ||= state.new_entity(:vertical_platformer)
state.vertical_platformer
@mohanpedala
mohanpedala / nginx_performance_tuning.md
Last active April 30, 2024 11:50
NGINX Performance tuning

NGINX Performance Tuning

Content Compressions and Decompression

  • Documentation
    • NGINX http_gzip module
    • NGINX http_gunzip module
  • Enable gzip. by default, we’re not going to compress the responses that we’re getting from proxied servers or any piece of content that isn’t HTML.
  • But if one of our proxied servers happens to send us a pre-compressed response then we probably want to decompress it for clients that can’t handle gzip. In this situation, we’ll use the gunzip module
    $ vim /etc/nginx/nginx.conf
@robinsloan
robinsloan / shh.rb
Last active August 18, 2023 12:09
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
@nrollr
nrollr / nginx.conf
Last active April 22, 2024 15:11
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
@dsandstrom
dsandstrom / .rubocop.yml
Last active August 27, 2022 22:30
Rubocop config files for Ruby 3.0 / Rails 6+
# .rubocop.yml
# rubocop config files for Ruby 3.0 / Rails 6+ project
AllCops:
TargetRubyVersion: 3.0
NewCops: enable
SuggestExtensions: false
Include:
@muttsnutts
muttsnutts / ReadChromeCookie.rb
Created August 26, 2013 02:04
Import cookie file in Mechanize -- chrome dB
require 'mechanize'
require 'sqlite3'
class ChromeCookieImporter
def initialize cookie_db = "#{ENV['HOME']}/AppData/Local/Google/Chrome/User Data/Default/Cookies"
@cookie_db = cookie_db
end
def each_line
db = SQLite3::Database.new(@cookie_db)
@saicologic
saicologic / app.rb
Created May 14, 2012 07:16 — forked from mfojtik/app.rb
sinatra with simple worker and queue
require 'rack'
require 'sinatra/base'
require 'uuidtools'
require 'rest-client'
require 'eventmachine'
require 'json'
require_relative './cache'
class Worker < EM::Connection
attr_reader :query
@micho
micho / nginx.conf
Last active September 29, 2023 16:38 — forked from unixcharles/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: