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> | |
typedef struct node_t { | |
int data; | |
struct node_t *next; | |
} Node; | |
Node *create(int data, Node *node) | |
{ |
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/env ruby | |
require 'fileutils' | |
ext, *name = ARGV | |
mode = '' | |
def help | |
abort 'Usage: gen [--html, --c] [FOLDER]' | |
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
#include <stdio.h> | |
int main() | |
{ | |
for (int i = 1; i < 100; ++i) | |
printf("%d\r%s%s\n", i, "Fizz"+4*!!(i%3), "Buzz"+4*!!(i%5)); | |
return 0; | |
} |
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 <stdint.h> | |
#define GOLDEN_RATIO 1.6180339887498948 | |
#define INV_GOLDEN_RATIO 0.6180339887498948 | |
#define INV_SQRT_5 0.4472135954999579 | |
#define loop(n) for (uint32_t _=0; _<(n); _++) | |
double fibonacci(const uint32_t * n){ | |
if (*n == 0) return 0.; |
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
num = 0 | |
keyword = false | |
commands = [] | |
define_method(:run) { |args| eval args*?\n rescue puts $!, $@ } | |
loop { | |
print (keyword ? "\e[44m .. \e[0m\t" : "\e[41m#{(num += 1).to_s.rjust(3)} \e[0m "); | |
expr = gets.chomp; | |
keyword = expr[/^(if|def)/] ? true : false; |
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
for (let a=[1,2,3][Symbol.iterator](),b; !(b=a.next()).done;) { | |
console.log(b.value); | |
} |
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
document.onclick = () => | |
document.querySelectorAll('.irc_mi').forEach((e) => e.parentNode.href = e.src); |
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
_ = $$ / $$ # 1 | |
__ = _ - _ # 0 | |
@_ = _ + _ # 2 | |
$_ = @_ + _ # 3 | |
$__ = @_ + $_ # 5 | |
$-_ = $__ * $_ # 15 | |
@__ = '' << $-_ * ($__ + $_) + @_ # z | |
$___ = '' << $-_ * $__ - $__ << $-_ * ($__ + @_) << @__ << @__ # Fizz | |
@___ = '' << $-_ * $__ - $_ * $_ << $-_ * ($__ + $_) - $_ << @__ << @__ # Buzz |
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 <iostream> | |
#include <conio.h> | |
#include <string> | |
#define KEY_UP 72 | |
#define KEY_DOWN 80 | |
#define KEY_LEFT 75 | |
#define KEY_RIGHT 77 | |
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) |
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
puts (rand(1..3) == 3) && `system -s -f -t 0` || 'Click' |