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' | |
| server = TCPServer.new 2000 | |
| socket = server.accept | |
| fork do | |
| loop do | |
| puts("Client: #{socket.recvmsg}") | |
| end | |
| end | |
| loop do |
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
| more... |
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
| syntax on | |
| set laststatus=2 | |
| set encoding=utf-8 | |
| set guifont=Lucida\ Sans\ Typewriter\ for\ Powerline:h13 | |
| let g:Powerline_symbols = 'fancy' | |
| if has("gui_running") | |
| set guioptions=egmrt | |
| set transparency=10 | |
| set guifont=menlo:h14 | |
| endif |
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 'pry' | |
| class Animal | |
| def initialize(name) | |
| @name = name | |
| end | |
| def say() | |
| begin | |
| raise NotImplementedError, "something goes wrong" | |
| rescue Exception | |
| puts $! |
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
| public class HelloMarkson { | |
| public static void main(String[] args) { | |
| String str = new java.lang.String("Hello Markson"); | |
| System.out.println(str); | |
| } | |
| } |
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
| function foo(){ | |
| x = 3 | |
| }; | |
| foo();//referenceError | |
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
| function say(a){ | |
| console.log(a) | |
| if(a < 5) | |
| say(a + 1) | |
| } | |
| say(1) |
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
| // Print the name and value of each property of o. Return undefined. function printprops(o) { | |
| for(var p in o) | |
| console.log(p + ": " + o[p] + "\n"); | |
| } |
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
| [28] pry(main)> class Users | |
| [28] pry(main)* attr_accessor :id, :first_name, :last_name | |
| [28] pry(main)* end |
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
| var m = { | |
| name:'Markson', | |
| gender:'Male', | |
| laugh:function(){ | |
| return "hahaha"; | |
| } | |
| } | |
| console.log(m.name); | |
| console.log(m.laugh()); |