ThinkBlog

philosophy :: psychology :: theology :: technology

04 April 2005

NoMorePasting (a code repository)

21:34:53 :: [technology &c.] :: 170 words

This site is a free “paste bin” service that lets people paste code snippets (or things such as error messages) so they can show them to others, typically people helping them on IRC or some other form of chat.

You don’t need to sign up and it wont cost you anything, just choose a category from the left to browse or paste some code for others to see. You’ll be given a unique link to your code that you can paste into whatever chatroom you’re using and you wont annoy people by “flooding” with lots of lines of code.

It’s innovations like this that earn my serious respect. Languages that this allows for are as follows: .NET, ASP, Assembler, C/C++, ColdFusion, Delphi, Java, JavaScript, mIRC Scripts (!), Perl, PHP, Python, RealBASIC, SQL, TCL, VisualBasic, and others. It’s difficult to navigate, but if you know what you’re looking for, you can sometimes find little nuggets in there, even if you’re not the one being told to find the link. :)

One Response to “NoMorePasting (a code repository)”

  1.  bt Says:

    bind pub n @add VT:add
    bind pub n @del VT:del

    proc VT:add { nick host hand chan text } {
    global commandline
    set command [string tolower [lindex [split $text ” “] 0]]
    set message [lrange [split $text ” “] 1 end]

    foreach bind [binds pub] {
    if {[string tolower [lindex $bind 2]] == [string tolower $command]} {
    putserv “NOTICE $nick :”${command}” already exists.”
    return 0
    }
    }

    set commandline “bind pub * $command VT:extra:${command} ; proc VT:extra:${command} { n u h c t } { putserv “PRIVMSG $c :${message}” }”

    uplevel #0 $::commandline

    if {[file exists “added_commands.tcl”]} {
    set file [open “added_commands.tcl” “a”]
    } else {
    set file [open “added_commands.tcl” “a”]
    puts $file “# This File is used to store commands added using !add”
    puts $file “# This file should not be edited by hand unless you know what you are doing.”
    puts $file “# ”
    puts $file ” ”

    }
    puts $file “# Command added by ${nick} (Handle: ${hand}) @ [clock format [unixtime]]”
    puts $file “${commandline}”
    puts $file ” ”
    close $file

    putserv “NOTICE $nick :D one and Added.”
    }

    proc VT:del { nick host hand chan text } {
    global firstbit
    set command [string tolower [lindex [split $text ” “] 0]]
    set message [lrange [split $text ” “] 1 end]

    set found 0

    if {[file exists “added_commands.tcl”]} {
    file rename “added_commands.tcl” “added_commands.tcl.old”
    set file [open “added_commands.tcl.old” “r”]
    set newfile [open “added_commands.tcl” “w”]
    while {![eof $file]} {
    set line [gets $file]
    set firstbit [string trim [lindex [split $line “;”] 0]]
    if {${firstbit} == “bind pub * $command VT:extra:${command}”} {
    namespace eval “” [split un${firstbit} ” “] ;# this is a cheap way to unbind
    namespace eval “” {rename [lindex [split ${firstbit} ” “] end] “”}
    set found 1
    } else {
    puts $newfile $line
    }
    }
    close $file
    close $newfile
    file delete “added_commands.tcl.old”
    }

    if {$found} {
    putserv “NOTICE $nick :D one and Removed.”
    } else {
    putserv “NOTICE $nick :Command “${command}” not found.”
    }
    }

    if {[file exists “added_commands.tcl”]} {
    source added_commands.tcl
    }

Leave a Reply

NoMorePasting (a code repository)

21:34:53 :: [technology &c.] :: 170 words

This site is a free “paste bin” service that lets people paste code snippets (or things such as error messages) so they can show them to others, typically people helping them on IRC or some other form of chat.

You don’t need to sign up and it wont cost you anything, just choose a category from the left to browse or paste some code for others to see. You’ll be given a unique link to your code that you can paste into whatever chatroom you’re using and you wont annoy people by “flooding” with lots of lines of code.

It’s innovations like this that earn my serious respect. Languages that this allows for are as follows: .NET, ASP, Assembler, C/C++, ColdFusion, Delphi, Java, JavaScript, mIRC Scripts (!), Perl, PHP, Python, RealBASIC, SQL, TCL, VisualBasic, and others. It’s difficult to navigate, but if you know what you’re looking for, you can sometimes find little nuggets in there, even if you’re not the one being told to find the link. :)

One Response to “NoMorePasting (a code repository)”

  1.  bt Says:

    bind pub n @add VT:add
    bind pub n @del VT:del

    proc VT:add { nick host hand chan text } {
    global commandline
    set command [string tolower [lindex [split $text ” “] 0]]
    set message [lrange [split $text ” “] 1 end]

    foreach bind [binds pub] {
    if {[string tolower [lindex $bind 2]] == [string tolower $command]} {
    putserv “NOTICE $nick :”${command}” already exists.”
    return 0
    }
    }

    set commandline “bind pub * $command VT:extra:${command} ; proc VT:extra:${command} { n u h c t } { putserv “PRIVMSG $c :${message}” }”

    uplevel #0 $::commandline

    if {[file exists “added_commands.tcl”]} {
    set file [open “added_commands.tcl” “a”]
    } else {
    set file [open “added_commands.tcl” “a”]
    puts $file “# This File is used to store commands added using !add”
    puts $file “# This file should not be edited by hand unless you know what you are doing.”
    puts $file “# ”
    puts $file ” ”

    }
    puts $file “# Command added by ${nick} (Handle: ${hand}) @ [clock format [unixtime]]”
    puts $file “${commandline}”
    puts $file ” ”
    close $file

    putserv “NOTICE $nick :D one and Added.”
    }

    proc VT:del { nick host hand chan text } {
    global firstbit
    set command [string tolower [lindex [split $text ” “] 0]]
    set message [lrange [split $text ” “] 1 end]

    set found 0

    if {[file exists “added_commands.tcl”]} {
    file rename “added_commands.tcl” “added_commands.tcl.old”
    set file [open “added_commands.tcl.old” “r”]
    set newfile [open “added_commands.tcl” “w”]
    while {![eof $file]} {
    set line [gets $file]
    set firstbit [string trim [lindex [split $line “;”] 0]]
    if {${firstbit} == “bind pub * $command VT:extra:${command}”} {
    namespace eval “” [split un${firstbit} ” “] ;# this is a cheap way to unbind
    namespace eval “” {rename [lindex [split ${firstbit} ” “] end] “”}
    set found 1
    } else {
    puts $newfile $line
    }
    }
    close $file
    close $newfile
    file delete “added_commands.tcl.old”
    }

    if {$found} {
    putserv “NOTICE $nick :D one and Removed.”
    } else {
    putserv “NOTICE $nick :Command “${command}” not found.”
    }
    }

    if {[file exists “added_commands.tcl”]} {
    source added_commands.tcl
    }

Leave a Reply


[powered by WordPress.]

For the discussion of current and historical trends in the liberal arts, information technology, and religious thought. "Of all human pursuits, the pursuit of wisdom is the more perfect, the more sublime, the more useful, and the more agreeable."

Think.

navigation

categories

search

archives

April 2005
S M T W T F S
« Mar   May »
 12
3456789
10111213141516
17181920212223
24252627282930

meta

ThinkBlog.org has been on the web since August 2003, with 292,449 words in 846 posts.

It is presently 06:24:20 on 08 Sep 2008, server side. All content except where otherwise noted Copyright © 2000-2006 Michael Phillips.

detail of Plato and Aristotle from 'The School at Athens' by Raphael

affiliations

Get Firefox! News for Nerds. Stuff that Matters.



Blogarama - The Blog Directory
Listed on Blogwise Listed on BlogShares

Blog Home

Login

35 queries. 1.038 seconds