Skip to content

Instantly share code, notes, and snippets.


Peter Arato itarato

Block or report user

Report or block itarato

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
itarato / non_blocking_queue.c
Last active Sep 30, 2019
Non blocking queue.
View non_blocking_queue.c
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#define EXAMPLE_SIZE 100
static pthread_mutex_t q_mtx; // = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t q_cond = PTHREAD_COND_INITIALIZER;
itarato / maze.hs
Last active Aug 19, 2019
Learning functional maze
View maze.hs
Funcitonal Maze
Run: runhaskell <SOURCE> <WIDTH::Int> <HEIGHT::Int> <RANDOM_SEED::Int>
- [W] [A] [S] [D]: move up, left, down, right
- [Q] [E|SPACE]: rotate counter-clockwise, clockwise
- [ESC]: quit
itarato / parser_combinator.rb
Last active Jul 7, 2019
Parser combinator trial
View parser_combinator.rb
require 'pp'
require "test/unit"
class String
def parse_response
def token
itarato /
Created Apr 30, 2019
DMG Boot logo beep sound prototype.
extern crate sdl2;
use sdl2::audio::{AudioCallback, AudioSpecDesired};
use std::sync::{Arc, Mutex};
use std::time::Duration;
struct SoundPacket {
pitch: f32,
len: Option<usize>,
volume: f32,
itarato /
Created Dec 8, 2018
Serde JSON nest digger
use serde_json::Value;
enum Shovel {
Key(&'static str),
fn dig(val: Value, with: &[Shovel]) -> Option<Value> {
if with.len() == 0 {
itarato / translation.rb
Last active Nov 28, 2018
Translation finder
View translation.rb
require 'yaml'
LANG = 'en'
subject = ARGV[0].split('.')
`find . -name '#{LANG}.yml'`
.map { |line| YAML.load([LANG] }
itarato / nqueen.rb
Last active Nov 9, 2018
N-Queen with recursive and non-recursive algorithm
View nqueen.rb
require 'pp'
def run_test
make_board = -> { { [0] * 8 } }
board =
return false unless ok?(board)
board =
board[0][0] = 1
itarato / stacklang.cpp
Created Oct 27, 2018
Stack base interpreter
View stacklang.cpp
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <regex>
#include <unordered_map>
#include <cmath>
using namespace std;
using value_t = double;
View brainfuck_interpreter.hs
import Data.Char
data VM = VM {
mem :: [Int],
ptr :: Int
tPlus = '+'
tMinus = '-'
tDot = '.'
itarato / discount_code_creation.go
Last active May 11, 2018
Stress test of discount code creation
View discount_code_creation.go
package main
import ""
import "fmt"
import "log"
import "strconv"
import "sync"
func main() {
var wg sync.WaitGroup
You can’t perform that action at this time.