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
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>What's the time, please?</title> | |
<script type="text/javascript" charset="utf-8"> | |
window.onload = function() { | |
var body_tag = document.getElementsByTagName("body")[0]; | |
var timer_div = document.getElementById("timer"); | |
function getRandomColor() { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <sys/wait.h> |
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
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <sys/ioctl.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <linux/cdrom.h> |
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
#include <stdio.h> | |
/* | |
* if (argc == 1) { | |
* printf("argc equals one\n"); | |
* } else { | |
* printf("argc is not one (%d)\n", argc); | |
* } | |
* return argc; | |
*/ |
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 'tempfile' | |
CELL_SIZE = 30_000 | |
ASM_STUB_X86_64 =<<EOF | |
.comm bf_cell, #{CELL_SIZE} | |
.global write_byte | |
.global sys_exit | |
.global _start |
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
<html> | |
<head><title>Chat</title></head> | |
<script> | |
window.onload = function() { | |
var chatRoom = new EventSource("/subscribe"); | |
console.log(chatRoom); | |
chatRoom.onmessage = function(event) { | |
var cw = document.getElementById("chat-window"); | |
cw.innerHTML += "<p>" + event.data + "</p><hr />"; | |
console.log(event); |
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
# Mining example | |
require 'benchmark' | |
require 'openssl' | |
def hash_ok?(hash, complexity) | |
hash.start_with?("0" * complexity) | |
end | |
# Appending a nonce the the | |
def create_target(str, nonce) |
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
// esversion: 6; | |
/// SETTINGS /// | |
// Maximum number of posts to be showed | |
const MAX_COUNT = 10; | |
// List of the subreddits, the desired sort order (multiple is allowed) | |
// and count of posts | |
const SUBREDDITS = [ | |
{ | |
name: 'spacex', |
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
// Compile with: gcc -O2 leaf.c -o leaf | |
// Proof: https://godbolt.org/z/vg1FSS | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
// Not actually tweaking the stack (except for ret) | |
int leaf_me_alone(int a, int b) | |
{ | |
return a*a + b*b / 2; |
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", ["hello", [], [ | |
["call", ["console", "log"], ["hello, world"]], | |
["return", []] | |
] | |
] | |
], | |
["function", ["addTwoNums", ["a", "b"], [ | |
["return", [ | |
["+", ["a", "b"]] |