Skip to content

Instantly share code, notes, and snippets.

View ByteDecoder's full-sized avatar
🏠
Working from home

Rodrigo Reyes ByteDecoder

🏠
Working from home
View GitHub Profile
@ByteDecoder
ByteDecoder / SMBDIS.ASM
Created September 8, 2023 17:48 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@ByteDecoder
ByteDecoder / sidekiq.service
Created April 1, 2023 02:24 — forked from sj26/sidekiq.service
systemd unit files for multiple sidekiq workers
[Unit]
Description=Sidekiq workers
# start as many workers as you want here
Wants=sidekiq@1.service
Wants=sidekiq@2.service
# ...
[Service]
Type=oneshot
ExecStart=/bin/true
@ByteDecoder
ByteDecoder / sidekiq@.service
Created March 30, 2023 21:45 — forked from Loriowar/sidekiq@.service
Systemd unit for multiprocess sidekiq. Based on example unit from official sidekiq page on GitHub.
# https://github.com/mperham/sidekiq/blob/master/examples/systemd/sidekiq.service
#
# systemd unit file for CentOS 7, Ubuntu 15.04
#
# Customize this file based on your bundler location, app directory, etc.
# Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu).
# Run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
@ByteDecoder
ByteDecoder / rspec_model_testing_template.rb
Created April 16, 2022 21:22 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@ByteDecoder
ByteDecoder / ghost_methods.md
Created March 29, 2022 17:47 — forked from samholst/ghost_methods.md
ruby 'ghost' methods

Ruby 'Ghost' Methods

Ghosts are spooooky!

But really this is just a goofy name for one of many options of dynamically creating methods in ruby which is part of that fancy business known as Metaprogramming. Which is a fancy name for the concept of writing code that 'writes' code. It's bananas and great and the best thing you will ever see in your career also it is terrible, horrible, no good and the worst thing you will ever see in your career. We are just going to go over what has been dubbed 'ghost' methods by someone who likes to have cool names for things, there is a lot more to metaprogramming in general than just this technique but it is a pretty good entry point.

@ByteDecoder
ByteDecoder / MinimalAPIs.md
Created November 22, 2021 22:22 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance
@ByteDecoder
ByteDecoder / unity_assets_relocation.md
Last active November 1, 2021 02:40
Move unity assets to another hard drive with more space instead of the OS hard drive default installation (Windows)

Steps:

1.- Create the destination directory in the desired drive with space, a lot of GB space

2.- Then copy all the content from %USERPROFILE%\AppData\Roaming\Unity into this new directory

3.- Delete the entire directory %USERPROFILE%\AppData\Roaming\Unity

4.- As and admin execute the command prompt and type:

@ByteDecoder
ByteDecoder / MyDB.cs
Created July 1, 2021 01:24 — forked from albertbori/MyDB.cs
.NET EntityFramework Encryption Example (C#)
public class MyDB : IdentityDbContext<User>
{
//DBSet properties go here
public MyDB()
{
((IObjectContextAdapter)this).ObjectContext.ObjectMaterialized += new ObjectMaterializedEventHandler(ObjectMaterialized);
}
#region Encryption
@ByteDecoder
ByteDecoder / ScreenCaptureEditor.cs
Created May 30, 2021 00:12 — forked from Tymski/ScreenCaptureEditor.cs
Unity make a screenshot from editor
using System.IO;
using UnityEditor;
using UnityEngine;
public class ScreenCaptureEditor : EditorWindow
{
private static string directory = "Screenshots/Capture/";
private static string latestScreenshotPath = "";
private bool initDone = false;
@ByteDecoder
ByteDecoder / date_helper.js
Created April 7, 2021 22:35 — forked from shuber/date_helper.js
fuzzy timestamps, time ago in words
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {