Skip to content

Instantly share code, notes, and snippets.

View SethHorsley's full-sized avatar
🦾
who knows

Seth Horsley SethHorsley

🦾
who knows
View GitHub Profile
@SethHorsley
SethHorsley / piping.rb
Created September 24, 2024 15:06
Function Piping
class Object
def pt(next_step)
case next_step
when Symbol
Kernel.send(next_step, self)
when String
method_name, *args = next_step.split(/[()]/).reject(&:empty?)
Kernel.send(method_name, self, *args)
else
raise TypeError, "Unsupported type for piping. Use Symbol for methods or String for methods with args."
@SethHorsley
SethHorsley / function_overloading.rb
Created September 24, 2024 15:06
function overloading
#!/usr/bin/ruby
module FunctionOverloading
def self.included(base)
base.extend(ClassMethods)
base.instance_variable_set(:@overloaded_methods, {})
end
module ClassMethods
def method_added(name)

HTML parser and lang parser in one AST

{
  type: 'element',
  tagName: 'div',
  properties: {className: ['foo'], id: 'some-id'},
  children: [
    {
      type: 'element',
Features Sidekiq Sidekiq Pro good_job solid_queue
Scheduled Jobs 🟢 🟢 🟢 🟢
Batches 🔴 🟢 [1] 🟢 [1] ?
Reliability 🔴 🟢 [1] 🟢 [1] 🟢 [1]
Search in web ui 🔴 🟢 [1] 🟢 [1] 🟠
Worker Metrics 🔴 🟢 [1] 🔵 [1] [2] [3] ?
E
@SethHorsley
SethHorsley / ruby-lang-tips.md
Created November 24, 2022 08:53
General Ruby Lang Tips 📝

Tips on ruby language helpers with examples

{{Class}}.included_modules

Want to see all included modules in a ruby class?

module Example
  def hello
    puts "hello"
  end
end
@SethHorsley
SethHorsley / The Technical Interview Cheat Sheet.md
Created November 1, 2021 11:00 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

defmodule Year do
@typedoc """
A 4 digit year, e.g. 1984
"""
@type cType :: {integer, String.t}
@type year :: integer
@spec current_age(year) :: cType
@SethHorsley
SethHorsley / MAMP_Dynamic_Virtual_Hosts.md
Created May 14, 2017 18:25 — forked from ch0c01d/MAMP_Dynamic_Virtual_Hosts.md
Simplify Local Development with MAMP & DNSMASQ (& XIP.io)

Simplify Local Development with MAMP & DNSMASQ

When you sit down and start a new project, often times, you'll want to set up a virtual host, a spoof domain that will emulate a live environment. The effort is usually two parts: set up a domain in /etc/hosts, and then add a <VirtualHost> entry in /Applications/MAMP/conf/apache/httpd.conf to make your files accessible.

This tutorial is setting up a 'zero-configuration' development environment. We'll be setting up a spoof domain ending in .dev. In MAMP, we'll create a folder called dev. Any folder inside, the name will become the domain.

@SethHorsley
SethHorsley / memes
Created January 30, 2017 07:03 — forked from GlowingAshes/memes
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main() {
int userDay = 0;
int userYear = 0;
int userMonth = 0;
import <iostream>
import 'X'
import 'ioX'
import 'etc'
using namespace std
int main()
{
define _X_ =x::title
var = login_details;
string = x_entered_login_details;