Skip to content

Instantly share code, notes, and snippets.

View vlastachu's full-sized avatar

Vlad Chuprin vlastachu

View GitHub Profile
module Main where
import Text.ParserCombinators.Parsec
import Control.Applicative ((<*>), (*>), (<*), (<$>), pure)
import Data.Functor
import Data.List
data CompilerState = CompilerState { commands :: [VMCommand],
errors :: [String],
variables :: [(String, Int)] } --Map
deriving (Eq, Show)
#lang racket
(define operators (hash '+ 5 '- 5 '* 10 '/ 10))
(define (priority operator)
(hash-ref operators operator 0))
(define (operator? operator)
(hash-has-key? operators operator))
/*
* BakerMemoryManager.cpp
*
* Implementation of BakerMemoryManager class
*
* LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2
*
* LLST is
* Copyright (C) 2012-2013 by Dmitry Kashitsyn <korvin@deeptown.org>
* Copyright (C) 2012-2013 by Roman Proskuryakov <humbug@deeptown.org>
@vlastachu
vlastachu / sample.hs
Created August 4, 2013 16:22
operator to change function and argument order
-- such functionality already exist in Control.Lens in '&' operator
-- '|>' alreade used in Data.Sequence
module Main where
(|>) :: a -> (a -> b) -> b
(|>) a fun = fun a
infixl 1 |>
main = print $ [1..10] |> map (*2) |> filter (>5) |> foldr1 (+)
-- have idea to improve that function: print $ [1..10] |> map (*2) |> filter (>5) |> foldr1 (+)
@vlastachu
vlastachu / main.cpp
Created May 18, 2013 20:52
simulate mouse action on winapi
#include <Windows.h>
#include <WinUser.h>
#include <iostream>
using namespace std;
int main(){
//0..65535,0..65535
int x =30000, y = 3000;
mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, x, y, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);