Skip to content

Instantly share code, notes, and snippets.

View teoulas's full-sized avatar
😺

Theodoros Orfanidis teoulas

😺
View GitHub Profile
@alexedwards
alexedwards / Makefile
Last active September 19, 2024 16:50
Boilerplate Makefile for Go projects
# Change these variables as necessary.
main_package_path = ./cmd/example
binary_name = example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
# Rails production setup via SQLite3 made durable by https://litestream.io/
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine.
#
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails
#
# in production you might want to map /data to somewhere on the host,
# but you don't have to!
#
FROM ruby:3.0.2
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active September 20, 2024 18:08
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jamesmacwhite
jamesmacwhite / Workarounds for Netflix and the blocking of IPv6 tunnels.md
Last active August 10, 2024 04:53
Prevent proxy/VPN streaming error messages from Netflix when using a Hurricane Electric IPv6 tunnel.

Workarounds for Netflix and the blocking of Hurricane Electric IPv6 tunnels

The dreaded "You seem to be using an unblocker or proxy." error message. Cool story bro.

This gist was essentially created out of my own rant about Netflix being hostile to IPv6 tunnel services since June 2016. You are welcome to read my opinion on the matter, this is the more technical side to the issue and how to combat it within your own network.

Since I wrote this, various GitHub users have contributed their thoughts and ideas which has been incorporated into this gist. Thank you to everyone who have contributed their own methods and implementations.

The problem

Netflix now treats IPv6 tunnel brokers (such as Hurricane Electric) as proxy servers. A while ago it became apparent to users and Netflix that somewhat by accident, IPv6 tunnel users were being served content outside of their geolocation because of the way Netflix was identifyi

@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@ejdyksen
ejdyksen / patch-edid.md
Last active August 12, 2024 05:57
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@savvas
savvas / active_admin.el.yml
Created January 29, 2012 19:36
Active Admin greek el translation yml file (i18n)
el:
active_admin:
dashboard: Διαχείριση
dashboard_welcome:
welcome: "Καλωσήρθατε στην σελίδα διαχείρισης"
call_to_action: "Για να προσθέσετε εργαλεία στην σελίδα διαχείρισης, δείτε εδώ 'app/admin/dashboards.rb'"
view: "Προβολή"
edit: "Επεξεργασία"
delete: "Διαγραφή"
delete_confirmation: "Είστε σίγουρος ότι θέλετε να προχωρήσετε στην διαγραφή?"
@wycats
wycats / marshal_proc.rb
Created November 19, 2011 06:11
Source code for marshaling a Proc in Rubinius. See http://yehudakatz.com/2011/11/19/how-to-marshal-procs-using-rubinius/ for more details
module Rubinius
class CompiledMethod
def _dump(depth)
Marshal.dump([@scope, Rubinius::CompiledFile::Marshal.new.marshal(self)])
end
def self._load(string)
scope, dump = Marshal.load(string)
cm = Rubinius::CompiledFile::Marshal.new.unmarshal(dump)
cm.scope = scope