Skip to content

Instantly share code, notes, and snippets.

View muloka's full-sized avatar
💖
I may be slow to respond.

Muloka muloka

💖
I may be slow to respond.
View GitHub Profile
@muloka
muloka / cuda_install.md
Last active January 8, 2024 14:29 — forked from denguir/cuda_install.md
Installation procedure for CUDA & cuDNN

How to install CUDA & cuDNN on Ubuntu 22.04

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

def yield_placeholder(name, content = nil, &block)
if content_for?(name)
concat @view_flow.get(name)
else
if block_given?
content = capture(&block)
end
concat content
end
end
// An Unobtrusive Javascript (UJS) driver based on explicit behavior definitions. Just
// put a "data-behaviors" attribute on your view elements, and then assign callbacks
// for those named behaviors via Behaviors.add.
var Behaviors = {
add: function(trigger, behavior, handler) {
document.observe(trigger, function(event) {
var element = event.findElement("*[data-behaviors~=" + behavior + "]");
if (element) handler(element, event);
});
@muloka
muloka / webapp.rb
Created November 16, 2010 21:41 — forked from igrigorik/webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end