Skip to content

Instantly share code, notes, and snippets.

View ZeroPivot's full-sized avatar
💭
Working on Managed Partitioned Array for DragonRuby

ArityWolf ZeroPivot

💭
Working on Managed Partitioned Array for DragonRuby
View GitHub Profile
#lulzy example of using self
class Something
attr_accessor :lol
def Something.new(*args) #pendatic... OR self.new (factory classes)
o = self.allocate.tap{ |s| puts "\t\tallocate: #{s.inspect} - #{s==self} - tap class: #{s.class} - self class: #{self.class}"} # create a new object of this class
o.send(:initialize, *args)
o
end
# [Written By: Vivex - eigenfruit@gmail.com] #
require 'fileutils'
#TODO:
=begin
-24-Sep-14 : most of the day
* Implemented File saving methods: [aoh_object].save!(file_location: "test", aoh: nil)
* As a side note: you may have to modify the get_id instance method to return a certain string (or false)
if there is no id at that particular location. Also, will rem_id return an error if it can't
find any data at that location.
@ZeroPivot
ZeroPivot / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ZeroPivot
ZeroPivot / powerset.rb
Last active October 18, 2017 14:24
Powerset
def powerset(array)
a=array
powerset=[]
(a.length).times do |num|
powerset << a.combination(num+1).to_a
end
powerset.flatten(1)
end
p powerset(["a", "b","c"])
integer checkWinner(key playingPlayer)
{
integer wonOrNot = FALSE;
llSay(4, "wait");
//Eight Possibilities
if (llList2Key(row1, 0) == playingPlayer && llList2Key(row1, 1) == playingPlayer && llList2Key(row1, 2) == playingPlayer) //Possibility 1
{
llSay(0, llKey2Name(playingPlayer) + " won!");
wonOrNot = TRUE;
get '/stderr' do
title "STDERR logs"
if File.exists?("is_local.config")
local=true
FileUtils.touch("/mnt/c/programming/sinatra_projects/comicman-remote/log/stderr")
else
local=false
FileUtils.touch("/root/comicman/log/stderr")
end
get '/stderr' do
title "STDERR logs"
if File.exists?("is_local.config")
local=true
FileUtils.touch("/mnt/c/programming/sinatra_projects/comicman-remote/log/stderr")
else
local=false
FileUtils.touch("/root/comicman/log/stderr")
end
//string to ascii
string ASCII = " \n !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
integer ord(string chr)
{
if(llStringLength(chr) != 1) return -1;
if(chr == " ") return 32;
return llSubStringIndex(ASCII, chr);
}
//string to ascii
string ASCII = " \n !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
integer ord(string chr)
{
if(llStringLength(chr) != 1) return -1;
if(chr == " ") return 32;
return llSubStringIndex(ASCII, chr);
}
//By: grrendel resident - kejento@gmail.com - start: 8/14/2014 - "fin": ??/??/????
//Log: * 8/16/2014 - Changed default PARTITION_BUFFER_BY to 4; certain functions required a change as well and ends with 2().
//Modified functions:
// * send_buffer2();
// * get_relative_buffer_location2();
// * add_to_buffer2();
//HAVE: A quick and dirty way to send a 'buffer' of data from "SL_server() -> router() -> home_computer()". 8/15/2014 - 5:36AM