This file contains hidden or 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
#!/usr/bin/perl | |
sub _osascript | |
{ | |
my $script = shift; | |
require IPC::Open2; | |
my( $read, $write ); | |
my $pid = IPC::Open2::open2( $read, $write, 'osascript' ); |
This file contains hidden or 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
#!/usr/bin/perl | |
sub _osascript | |
{ | |
my $script = shift; | |
require IPC::Open2; | |
my( $read, $write ); | |
my $pid = IPC::Open2::open2( $read, $write, 'osascript' ); |
This file contains hidden or 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
#!/usr/bin/perl | |
sub _osascript | |
{ | |
my $script = shift; | |
require IPC::Open2; | |
my( $read, $write ); | |
my $pid = IPC::Open2::open2( $read, $write, 'osascript' ); |
This file contains hidden or 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
#/usr/bin/ruby | |
require "socket" | |
# Here we require things for use later on... | |
require "net/http" # For parsing things... | |
require "rexml/document" # For XML parsing. | |
nick = "CB|RubyBot" | |
server = "irc.freenode.net" | |
port = 6667 |
This file contains hidden or 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
#/usr/bin/ruby | |
require "socket" | |
# Here we require things for use later on... | |
require "net/http" # For parsing things... | |
require "rexml/document" # For XML parsing. | |
nick = "CB|RubyBot" | |
server = "irc.freenode.net" | |
port = 6667 |
This file contains hidden or 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
require 'socket' | |
def c(nick) | |
@array = [] | |
@nickvar = nick.to_s | |
@nickvar = TCPSocket.new("irc.dav7.net",6667) | |
@nickvar.send("USER CB#{nick} CB#{nick} CB#{nick} :CB#{nick}\n",0) | |
@nickvar.send("NICK CB#{nick}\n",0) | |
#puts nickvar.recv(1024) | |
@array.push(@nickvar) |
This file contains hidden or 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
class AnnouncementsController < ApplicationController | |
helper_method :redirect_to | |
before_filter :require_user, :except => "new" | |
# GET /announcements | |
# GET /announcements.xml | |
def index | |
@announcements = Announcement.find(:all) | |
respond_to do |format| | |
format.html # index.html.erb |
This file contains hidden or 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
#!/usr/bin/ruby | |
batt_stats = %x[ioreg -n battery -w 0 | grep BatteryInfo] | |
stats_info = batt_stats.match(/"Capacity"=(.*),"Amperage"=(.*),"Cycle Count"=(.*),"Current"=(.*),"Voltage"=(.*),"Flags"=(.*),"AbsoluteMaxCapacity"=(.*)\}/i) | |
stats_info = stats_info.to_a | |
capacity = stats_info[1].to_i | |
amperage = stats_info[2].to_i | |
cycle_count = stats_info[3].to_i | |
current = stats_info[4].to_i | |
voltage = stats_info[5].to_i | |
flags = stats_info[6].to_i |
This file contains hidden or 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
<?php | |
$source = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=pcon2009"); | |
// First, get each of them in an array. It's easy to do this using explode(). | |
$list = explode("\n",$source); // Put each in an array | |
$l = array(); | |
foreach($list as $line){ // Iterate through the $list array. | |
// This gets a little confusing... | |
// Every time we iterate through the $list array, we add |
This file contains hidden or 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
<?php | |
$source = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=pcon2009"); | |
include "ranks.php"; // so we have $array. | |
// First, get each of them in an array. It's easy to do this using explode(). | |
$list = explode("\n",$source); // Put each in an array | |
$l = array(); | |
$i = 0; | |
OlderNewer