Public Gists by oleganza

Gravatar
Fri Nov 20 00:56:38 -0800 2009
1
2
3
def smallAsciiRepresentation(digest)
 
  digestParts = digest.unpack("Q2") # digest is a 128 bit buffer, cut it into two 64 bits ruby Integer
Gravatar
Thu Nov 19 07:06:45 -0800 2009
1
2
3
module Id64 extend self
  Alphabet = "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_-"
  (Alphabet.size == 64) or raise "Alphabet should have 64 characters!"
Gravatar
Mon Nov 02 05:59:06 -0800 2009
1
2
3
require 'strscan'
require 'cgi'
 
Gravatar
Fri Oct 30 11:38:26 -0700 2009
1
2
3
class BlankSlate
  class <<self; alias __undef_method undef_method; end
  alias __instance_eval instance_eval
Gravatar
Fri Oct 16 02:12:31 -0700 2009
1
2
3
# Oleg Andreev <oleganza@gmail.com> Oct 16, 2009
#
# This demonstrates how to perform a request to the same Rails instance without hitting HTTP server.
Gravatar
Mon Jul 13 07:05:45 -0700 2009
1
2
3
module Id64 extend self
  Alphabet = "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_-"
 
Gravatar
Thu Jul 09 05:23:52 -0700 2009
1
2
3
# Simple cache implementation for DB supporting simple collection retrieval
 
# Static types (i.e. tables) are omitted for brevity.
Gravatar
Wed May 06 09:27:49 -0700 2009
1
2
3
# I wonder why we still use File instance monkey-patching
# instead of a regular subclass/delegator?
# Every time you test uploaded files, you come up with a brand-new mock.
Gravatar
Mon May 04 08:30:24 -0700 2009
1
2
3
// BNF parser framework for JavaScript
// Oleg Andreev
 
Gravatar
Tue Apr 07 07:31:12 -0700 2009
1
2
3
package pierlis.framework
{
  import flash.events.*
Gravatar
Fri Mar 13 07:28:59 -0700 2009
1
2
3
#!/usr/bin/env ruby
# Reclone current directory to refresh Flash CS3 brains about classpath
# (after that please do "cd .")
Gravatar
Wed Mar 11 04:18:02 -0700 2009
1
2
3
/* treat double click as a single click (hello, Mom! :-)
 function onMouseDown(){
   if (!SingleClick()) return
Gravatar
Wed Mar 11 03:03:38 -0700 2009
1
2
3
/*
  The simplest possible state machine implementation in AS3.
  
Gravatar
Thu Feb 05 02:29:10 -0800 2009
1
2
3
Oleg Andreev:
щас пишу named args для Io
с ними проблема есть концептуальная:
Gravatar
Mon Feb 02 02:04:40 -0800 2009
1
2
3
    class ::Object
      def hide_inspect_for_one_shot(replacement = "#<#{self.class}:0x#{object_id.to_s(16)}>")
        return unless self
Gravatar
Mon Feb 02 01:27:09 -0800 2009
1
2
3
In response to all the responses to:
 
http://twitter.com/rtomayko/status/1155906157
Gravatar
Mon Jan 05 07:34:57 -0800 2009
1
2
3
# app/controllers/application/authentication.rb
class Application
  module Authentication
Gravatar
Mon Jan 05 07:24:11 -0800 2009
1
2
3
# BEFORE
 
    def access_denied!
Gravatar
Fri Jan 02 07:40:24 -0800 2009
1
2
3
module PluralizedConsts
  P = self
  
Gravatar
Tue Dec 09 02:23:53 -0800 2008
1
2
3
#
# Helps to authenticate person using password and email
#