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
#include <stdio.h> | |
#include <sys/types.h> | |
int main(void){ | |
pid_t this_process; | |
this_process = getpid(); | |
printf("this process value is %d and hex value if 0x%x\n", this_process,this_process); | |
} |
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
$ jist a.rb | |
https://gist.github.com/0d07bc98c139810a4075 | |
By default it reads from STDIN, and you can set a filename with -f. | |
$ jist -f test.rb <a.rb | |
https://gist.github.com/7db51bb5f4f35c480fc8 | |
Alternatively, you can just paste from the clipboard: | |
$ jist -P | |
https://gist.github.com/6a330a11a0db8e52a6ee |
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 ipdb | |
import re | |
import sys | |
PROMPT_SIZE = "Board size: " | |
ERROR_SIZE = "Size must be an odd number between 5 and 9" | |
PROMPT_MOVE_X = "Player X, enter move: " # Or player Y ... | |
PROMPT_MOVE_Y = "Player Y, enter move: " # Or player Y ... | |
ERROR_MOVE_LENGTH = "Move must be 5 characters" | |
ERROR_MOVE_PIECE ="Error move piece" # e.g player X can not move piece "Y" or piece that was used by the opponent in his/her last move. | |
ERROR_MOVE_POSITION = "Invalid position" # you can't place your player on occupied position, or place S on "T", or go over the board |
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 m = { | |
name:'Markson', | |
gender:'Male', | |
laugh:function(){ | |
return "hahaha"; | |
} | |
} | |
console.log(m.name); | |
console.log(m.laugh()); |
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
[28] pry(main)> class Users | |
[28] pry(main)* attr_accessor :id, :first_name, :last_name | |
[28] pry(main)* 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
// 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 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 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 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 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 $! |
OlderNewer