Skip to content

Instantly share code, notes, and snippets.

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

kaocher kaocher82

🏠
Working from home
View GitHub Profile
class User < ActiveRecord::Base
has_many :memberships
has_many :groups, through: :memberships
end
class Group < ActiveRecord::Base
has_many :memberships
has_many :members, class_name: 'User', through: :memberships
end
@kaocher82
kaocher82 / 1old.js
Created March 21, 2021 21:32 — forked from tubbo/1old.js
new syntax for changing how this-binding to functions works. just an idea for now.
class App {
ready() {
alert("hello")
}
}
const app = new App()
document.addEventListener("DOMContentLoaded", app.ready.bind(app))
// or
package main
type Addable interface {
Total int
Add(value int) int
}
func (addable *Addable) Add(value int) int {
addable.Total = addable.Total + value
@kaocher82
kaocher82 / .gitignore
Created December 5, 2020 18:36 — forked from stbuehler/.gitignore
Force any binary to use a specific network interface in Linux
*.so
@kaocher82
kaocher82 / clearbit-api.markdown
Created November 14, 2018 21:08
clearbit API