Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
require "net/http"
# Veeery simple recaptcha client.
# In your controller or filter
# @recaptcha = Recaptcha.new(:pubkey => your_public_key, :privkey => your_private_key)
# In the view
# <%= @recaptcha.form %>
# In the accepting action, rescue from Recaptcha::Failed
# begin
# @recaptcha.verify!(:env => env, :params => params)
# An XML writer for Ruby's XML RPC module
require 'rubygems'
require 'builder'
# The default XML serializer in Ruby's XML RPC module is VERY sloppy.
# We use Jim Weirich's excellent Builder to generate clean XML, even though it costs us some extra
# performance
class RPCBuilder
# This is what is going to be lugged around as XML RPC results. It's actually
def create
@obj = SomeClass.create(params[:shmoo])
execute_callbacks :on => :shmoo_creation, :with => @obj
redirect_to somewhere
end
def execute_callbacks(options)
@callbacks ||= {}
GetGlobalPos(obj) // Get the global transform matrix for an object independently of the parenting
{
var globalMatrix = obj->GetMg();
return globalMatrix->GetV0();
}
main(doc,op)
{
var radius = 50;
#include "grid.h"
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
double pixX;
double pixY;
//SIZZLET Rename and Renumber Selected Trackers
// Renames or prefixes selected tracker names
dlg = NewDialog("pfxTrackersDLG")
dlg.Radio("doPrefix", "Prefix existing names", 1)
dlg.Radio("doSuffix", "Suffix existing names", 0)
dlg.Radio("doRename", "Rename and renumber in selection", 0)
dlg.String("renameString", "Name prefix", "Xtra")
set cut_paste_input [stack 0]
version 6.0 v7
Ramp {
inputs 0
p0 {0 0}
p1 {0 1556}
color {0 1 0 0}
name Ramp1
selected true
xpos 181
RotoPaint {
toolbar_brush_hardness 0.200000003
toolbar_lifetime_type all
toolbar_source_transform_scale {1 1}
toolbar_source_transform_center {1024 778}
output alpha
premultiply rgb
curves {AnimTree: "" {
Version: 1.2
Flag: 0
# We send this as a response object. Rack can use any object that responds to each() as
# response body. When each() is called, the object
# will activate the FTP connection and couple the FTP receive loop with the HTTP send loop.
# This will probably go totally kaput on shitservers like Webrick that still insist on buffering
# any output, but someone who uses Webrick can better shoot himself on the spot. Since
# we provide range support, we need to pass it downstream to the FTP server and we need to send
# exactly the amount of bytes requested to satisfy range.
class Fatpete::FTPStream
CHUNK_SIZE = 128 * 1024
SLEEP_BETWEEN_CHUNKS = 0.1
set cut_paste_input [stack 0]
version 6.0 v7
push $cut_paste_input
Group {
name GrowFront
selected true
xpos -465
ypos -223
addUserKnob {20 growfront l GrowFront}
addUserKnob {41 grow T GrowBlur.size}