This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
OlderNewer