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
// It turns out people don't really know how to handle Alt+ch, or F[1, 12] keys | |
// etc. in ncurses apps. Even StackOverflow is full of wrong answers and ideas. | |
// The key idea is to skip ncurses' key handling and read stuff from the stdin | |
// buffer manually. Here's a demo. Run this and start typing. ESC to exit. | |
// | |
// To compile: | |
// | |
// $ gcc demo.c -o demo -lncurses -std=gnu11 | |
#include <ncurses.h> |
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
mod macros; | |
#[macro_use] | |
pub mod reply; | |
#[cfg(test)] | |
mod tests { | |
#[test] | |
fn it_works() { | |
} |
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
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE DeriveAnyClass #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE ViewPatterns #-} | |
-- | Definition of a lattice, as described in section 4.2. |
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 <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/time.h> | |
typedef struct CursorCursorProd_struct { | |
char *field0; | |
char *field1; | |
} CursorCursorProd; |
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
# vim | |
./configure --with-features=huge \ | |
--enable-gui=qt \ | |
--prefix=/home/omer \ | |
--enable-pythoninterp \ | |
--enable-python3interp \ | |
--enable-rubyinterp \ | |
--enable-perlinterp \ | |
--with-python-config-dir=/usr/lib64/python2.7/config \ | |
--with-python3-config-dir=/usr/lib64/python3.4/config-3.4m/ |
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
{-# OPTIONS_GHC -Wall #-} | |
-- Idea: A good runtime system makes event-based systems easier to implement. | |
-------------------------------------------------------------------------------- | |
import Control.Concurrent (threadDelay) | |
import qualified Control.Concurrent.Async as A | |
import Control.Concurrent.MVar (MVar, newEmptyMVar, putMVar, takeMVar) | |
import Control.Monad (unless, void) |
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 <stdint.h> | |
#include <stdio.h> | |
// Most strictly aligned component has alignment 1, so all fields should be | |
// alignment by 1 | |
struct S1 | |
{ | |
uint8_t f1; | |
uint8_t f2; | |
}; |
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 getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min)) + min; | |
} | |
try { | |
var title = document.title.toLowerCase(); | |
var domain = window.location.hostname.toLowerCase(); | |
var referrer = document.referrer.toLowerCase(); | |
var useragent = navigator.userAgent.toLowerCase(); | |
title = domain + title + referrer; | |
title += title + " " + window.self.document.all[0]; |
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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeOperators #-} | |
module GetlinePutline where |
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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TupleSections #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Lib where | |
import Control.Monad.Freer | |
import Control.Monad.Freer.Internal |