Skip to content

Instantly share code, notes, and snippets.

View Eric-Guo's full-sized avatar

Eric Guo Eric-Guo

View GitHub Profile
@chockenberry
chockenberry / README
Created April 6, 2022 17:32
A simple AppleScript to start up a web server in the folder where the script is located.
1) Add this code to a new file in Script Editor
2) Export the script as "Application" and make sure it's code signed
3) Put "Startup.app" in the root folder of the test website (e.g. where index.html is located)
4) Make sure that "Startup.app" has Full Disk Access in System Preferences > Security & Privacy > Privacy
@lukaskubanek
lukaskubanek / fn-shortcuts.md
Last active February 21, 2024 16:26
macOS Monterey Keyboard Shortcuts Leveraging the Fn Key
Shortcut Description Overridable?[^1]
Fn-A Navigate Dock No
Fn-Shift-A Launchpad No
Fn-C Control Center No
Fn-E Emoji & Symbols Yes
Fn-F Enter/Exit Full Screen Yes
Fn-H Desktop No
Fn-M Navigate Main Menu Yes
Fn-N Notifications No
@madawei2699
madawei2699 / README.md
Last active March 7, 2022 05:17
samesite strict mode test

SameSite Strict Test

Benefit of SameSite Strict

If the SameSite attribute is set to Strict, then the browser will not include the cookie in any requests that originate from another site. This is the most defensive option, but it can impair the user experience, because if a logged-in user follows a third-party link to a site, then they will appear not to be logged in, and will need to log in again before interacting with the site in the normal way.

If the SameSite attribute is set to Lax, then the browser will include the cookie in requests that originate from another site but only if two conditions are met:

  • The request uses the GET method. Requests with other methods, such as POST, will not include the cookie.
  • Imagine we have a very bad design and all our actions are performed on GET method. The attacker placed link saying "Save puppies" which links to http://oursite.com/users/2981/delete
@yahonda
yahonda / ruby31onrails.md
Last active April 15, 2025 20:01
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.
@icculus
icculus / sdl-gpu-pitch.md
Last active August 25, 2024 12:03
This is the Epic MegaGrant pitch I wrote for the SDL GPU API, in case anyone is interested.

Describe your project:

Simple Directmedia Layer (SDL) is the gold standard for low-level, cross-platform game development. It is an open source library that is used at the layer where one might use DirectX, so it's useful both for from-scratch development and for powering game engines. It provides abstractions for video, audio, input, and various system-provided functionality. In many cases, if you're building a cross-platform game, SDL is extremely good at helping you delete a large number of #ifdefs in your project...and entire directories full of code.

SDL is used in the Steam Client, is crucial to the Linux game development ecosystem, and has been used for various platforms in every generation of the Unreal Engine, idTech, Source Engine, etc.

A game written to use SDL might work with almost no code changes across all major desktop operating systems, mobile phones, web browsers, and even the Raspberry Pi. Nintendo shipped SDL in over 7.5 million NES and SNES Classic devices. There are SDL-based games

@amirrajan
amirrajan / main.rb
Last active November 29, 2021 19:10
DragonRuby Game Toolkit VR (Virtual Reality/Oculus Quest) - Let There Be Light https://www.youtube.com/watch?v=S-baJwEjUsk&ab_channel=AmirRajan
# https://www.youtube.com/watch?v=S-baJwEjUsk&ab_channel=AmirRajan
class Game
attr_gtk
def tick
grid.origin_center!
defaults
calc
render
@LItterBoy-GB
LItterBoy-GB / node2ruby.c
Last active January 25, 2022 07:36 — forked from fate0/node2ruby.c
turn ruby ast to ruby source code
/**********************************************************************
node2ruby.c - ruby node tree to ruby source code
Copyright (C) 2017 fate0
//在 iseq.c 中实现 rb_iseq_nex
VALUE
rb_iseq_nex(NODE *node, VALUE name, VALUE path, VALUE absolute_path,
VALUE parent, enum iseq_type type)
{
"recommendations": [
"aeschli.vscode-css-formatter",
"ahmadalli.vscode-nginx-conf",
"aliariff.vscode-erb-beautify",
"be5invis.toml",
"bierner.markdown-preview-github-styles",
"bradlc.vscode-tailwindcss",
"bradymholt.pgformatter",
"crystal-lang-tools.crystal-lang",
@jaredcwhite
jaredcwhite / funky.config.js
Last active May 20, 2021 03:40
Personal configuration of Funky class-less utility CSS. https://native-elements.dev/#/docs/funky/introduction
module.exports = {
minify: false,
outputPath: "frontend/styles/funky-utilities.css",
breakpoints: {
xs: { max: "575px" },
sm: { min: "576px", max: "767px" },
md: { min: "768px", max: "991px" },
lg: { min: "992px", max: "1199px" },
xl: { min: "1200px", max: "1399px" },
xxl: "1400px"
@2color
2color / test.yaml
Last active April 10, 2024 18:57
How to run integration tests with PostgreSQL and Prisma on GitHub Actions
# .github/workflows/test.yaml
name: test
on: push
jobs:
test:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres: