Skip to content

Instantly share code, notes, and snippets.

View onyxblade's full-sized avatar
🎗️

onyxblade

🎗️
View GitHub Profile
@onyxblade
onyxblade / memoist.rb
Last active June 1, 2023 23:29
A dead simple memoize library for Ruby
# There are many fancier memoize libraries out there:
# https://github.com/tycooon/memery
# https://github.com/makandra/memoized
# Some of them support expiration, some memoizing methods with arguments.
# However, I just want a dead simple implementation that memoizes getters only.
module Memoist
def memoize name
if instance_method(name).arity != 0
# This gist is to demonstrate why camille requires plain namespaces instead of nested ones.
module Camille
module Types
module Nested
end
end
module Schemas
module Nested
@onyxblade
onyxblade / gist:8e9aaad85ad880af7fa6d5641249b82e
Created February 6, 2023 23:05
Tampermonkey userscript to fix Cineplex player "Error loading. Tap to retry." on Linux
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://store.cineplex.com/Product/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=cineplex.com
// @grant none
// ==/UserScript==
<style>
.parent {
margin-top: -690px;
margin-left: -360px;
position: absolute;
opacity: 0.2; /* in real opacity:0 */
z-index: 1;
}
</style>

Keybase proof

I hereby claim:

  • I am CicholGricenchos on github.
  • I am cichol (https://keybase.io/cichol) on keybase.
  • I have a public key whose fingerprint is 2A6C 82C0 8D10 76C6 FC28 43F9 2C4A 7D75 3E54 7F22

To claim this, I am signing this object:

extern const godot_gdnative_core_api_struct *api;
VALUE rb_godot_bool_from_godot (godot_bool);
godot_bool rb_godot_bool_to_godot (VALUE);
VALUE rb_godot_real_from_godot (godot_real);
godot_real rb_godot_real_to_godot (VALUE);
VALUE rb_godot_int_from_godot (godot_int);
godot_int rb_godot_int_to_godot (VALUE);
VALUE rb_godot_vector3_axis_from_godot (godot_vector3_axis);
godot_vector3_axis rb_godot_vector3_axis_to_godot (VALUE);
VALUE rb_signed_char_from_godot (signed char);
function lodash (obj) {
var createProxy = function (obj) {
return new Proxy(obj, {
get (target, name) {
if (_[name]) {
return function (...args) {
var result = _[name](target, ...args)
if (typeof result === 'object') {
return createProxy(result)
} else {
@onyxblade
onyxblade / jail.rb
Last active November 5, 2017 09:24
#!/usr/bin/env ruby
require 'readline'
proc {
my_exit = Kernel.method(:exit!)
my_puts = $stdout.method(:puts)
ObjectSpace.each_object(Module) { |m| m.freeze if m != Readline }
set_trace_func proc { |event, file, line, id, binding, klass|
bad_id = /`|exec|foreach|fork|load|method_added|open|read(?!line$)|require|set_trace_func|spawn|syscall|system/
bad_class = /(?<!True|False|Nil)Class|Module|Dir|File|ObjectSpace|Process|Thread/
#include <stdio.h>
double factorial(int n){
if(n < 1){
return 1;
} else if(n == 1){
return n;
} else {
return n * factorial(n - 1);
}
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", path: "./rails"