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 start( port = 24842 ) | |
server = TCPServer.new( port ) | |
log "[server log] Server started on localhost: #{port}" | |
while @session = server.accept | |
# 1) get the username | |
username = @session.gets.chomp | |
log "[server log] Received Client's Username: #{username}" | |
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
require 'thread' | |
require 'resolv' | |
class Logger | |
def initialize( infile = 'old-log.txt' , outfile = 'new-log.txt', max_threads = 3 ) | |
@cache = {} | |
@queue = Queue.new | |
@list = [] | |
@threads = [] |
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
require 'socket' | |
class ChatClient | |
def initialize | |
@server = TCPSocket.open( 'localhost', 36963 ) | |
connectToServer | |
end | |
def connectToServer |
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
$(function(){ | |
$('#jqt').ajaxComplete(function(){ | |
add_ga(); // add google analytics on each page load | |
}); | |
$(document).ready(function() { | |
add_ga(); // add google analytics to the first page | |
}); | |
function add_ga() { |
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
<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 163dpi)" href="/iOS-57px.png" /> | |
<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 132dpi)" href="/iOS-72px.png" /> | |
<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 326dpi)" href="/iOS-114px.png" /> |
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
if (window.devicePixelRatio == 2) { | |
// All yer codez Here | |
} |
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
/* Sets Size of box containing gradients */ | |
.layer{ | |
width: 48px; | |
height: 32px; | |
} | |
/* Final Combined Gradient Image Composition */ | |
.all{ |
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
/* Border & Vignette Setup */ | |
figure{ | |
position: relative; | |
display: block; | |
line-height: 0; | |
width: 500px; | |
height: 333px; | |
margin-bottom: 2em; | |
border: 1em solid #fff; |
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
(function(countdown, container){ | |
var index; | |
function log(){ | |
console.log(index); | |
} | |
function iterate(){ | |
log(); |
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
var Car = function(make, color){ | |
this.make = make; | |
this.color = color; | |
}; | |
function logCar(c){ | |
console.log("I'm a " + c.color + " " + c.make); | |
} | |
Car.prototype.log = function(){ |