Skip to content

Instantly share code, notes, and snippets.

View elct9620's full-sized avatar
💦
Level up!!!

蒼時弦也 elct9620

💦
Level up!!!
View GitHub Profile

Ruby: The future of frozen string literals

What is a literal?

In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.

Some examples:

7 # integer literal
@amirrajan
amirrajan / demo.md
Last active October 30, 2022 22:22
DragonRuby Game Toolkit - Tech Demo Source Code
the-keeper-iteration-2.mp4
@JoelQ
JoelQ / tree_enumerator.rb
Created August 21, 2022 22:15
Demonstration of how using `Enumerator` makes it nicer to work with a data structure that has multiple valid traversals such as a binary tree
class Tree
attr_reader :val, :left, :right
def self.empty
EmptyTree.new
end
def self.leaf(val)
new(val, empty, empty)
end
@yahonda
yahonda / ruby31onrails.md
Last active October 21, 2024 18:20
Ruby 3.1 on Rails

Ruby 3.1 on Rails

Actions required to use Ruby 3.1.0 with Rails

Rails 7.0.Z

  • Rails 7.0.1 is compatible with Ruby 3.1.0.
  • Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
  • thor 1.2.1 has been released. You will not see DidYouMean::SPELL_CHECKERS.merge deprecate warnings anymore.

Rails 6.1.Z

  • Use Rails 6.1.5 to support database.yml with aliases and secrets.yml with aliases.
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.IO;
using System;
using System.Text.RegularExpressions;
using System.Linq;
// Original code by PlayItSafe_Fries
@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@brunneis
brunneis / fix-eth-hang.md
Last active October 21, 2024 02:57
Proxmox | Fix "e1000e Detected Hardware Unit Hang"
Proxmox Virtual Environment 6.1-3 / Debian 10 (buster)
Kernel 5.3.10-1-pve
Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V (rev 05)
Ethernet driver: e1000e 3.2.6-k
Ethernet firmware: 0.1-4

The solution I've found was to create a oneshot service which disables segmentation offloading.

@girvan
girvan / cloudflare.html
Created June 27, 2019 06:49
track cloudflare's edge location by using GA event
<script>
(function(){
var request = new XMLHttpRequest();
request.open('GET', '/cdn-cgi/trace', true);
request.onload = function() {
if (request.status != 200) return;
var match = request.responseText.match(/(colo|loc)=(\w+)/g),
colo = match[0].split('=')[1], loc = match[1].split('=')[1];
ga('send', 'event', 'cloudflare', loc, colo);
};
@bitinn
bitinn / .a-unity-git-config.md
Last active June 25, 2024 13:21
My Unity git config
@poychang
poychang / privacy-policy-template-eng.md
Last active April 29, 2024 11:39
隱私權條款範本

Privacy Policy Template

Welcome to [Your Website Name] (hereinafter referred to as "the Website"). In order to provide you with a secure and seamless experience while using the various services and information on our website, we are committed to protecting your privacy rights. Please read the following information carefully:

1. Scope of Privacy Policy

This Privacy Policy outlines how we handle the collection, processing, and utilization of personal identifiable information when you use our website's services. This Privacy Policy does not apply to other related websites not operated by us or to individuals not managed or commissioned by us.

2. Collection, Processing, and Utilization of Personal Data