Skip to content

Instantly share code, notes, and snippets.

View dru's full-sized avatar

Andrii Melnyk dru

  • Unteleported.com
  • Kyiv, Ukraine
View GitHub Profile
@dru
dru / wgsl_3d_sdf.md
Created August 1, 2022 10:17 — forked from munrocket/wgsl_3d_sdf.md
3D SDF Primitives in WGSL

3D SDF Primitives in WGSL

How to use this gist:

  1. Build a sphere tracer with WebGPU (paper, paper2, youtube)
  2. Create model with sdf functions from here
  3. Add light and shadows
  4. ???
  5. PROFIT

This code tested in Chrome and Firefox, should work on PC too.

@dru
dru / Rakefile
Created April 12, 2012 17:53 — forked from jeffreyiacono/Rakefile
rake task for precompiling assets using sprockets within a sinatra app + view helpers
require 'rubygems'
require 'bundler'
Bundler.require
require './application'
namespace :assets do
desc 'compile assets'
task :compile => [:compile_js, :compile_css] do
end
@dru
dru / active_admin_mongomapper_patches.rb
Created April 10, 2012 15:45 — forked from larsrottmann/active_admin_mongomapper_patches.rb
Enable basic MongoMapper support in ActiveAdmin
# config/initializers/active_admin_mongomapper_patches.rb
require "active_admin"
require "active_admin/resource_controller"
require 'ostruct'
module ActiveAdmin
class Namespace
# Disable comments
def comments?
set :rails_env, :production
set :unicorn_binary, "/usr/bin/unicorn"
set :unicorn_config, "#{current_path}/config/unicorn.rb"
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
@dru
dru / nginx_rails_3_1
Created March 14, 2012 12:47 — forked from shapeshed/nginx_rails_3_1
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
server {