Skip to content

Instantly share code, notes, and snippets.

View osa1's full-sized avatar

Ömer Sinan Ağacan osa1

View GitHub Profile
@pervognsen
pervognsen / shift_dfa.md
Last active January 27, 2024 19:54
Shift-based DFAs

A traditional table-based DFA implementation looks like this:

uint8_t table[NUM_STATES][256]

uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
    for (const uint8_t *s = start; s != end; s++)
        state = table[state][*s];
    return state;
}
@ltratt
ltratt / highlight_words_in_vim.vim
Created July 21, 2020 07:58
Highlight words in Vim
" Highlight Word, initial version from:
" https://gist.github.com/emilyst/9243544#file-vimrc-L142
"
" This mini-plugin provides a few mappings for highlighting words temporarily.
"
" Sometimes you're looking at a hairy piece of code and would like a certain
" word or two to stand out temporarily. You can search for it, but that only
" gives you one color of highlighting. Now you can use <leader>N where N is
" a number from 1-6 to highlight the current word in a specific color.
"
@edsko
edsko / Collect.hs
Last active September 10, 2018 15:15
Applicative-only, spaceleak-free version of 'WriterT'
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
module Main where
import Data.Functor.Identity
import Data.Monoid
anonymous
anonymous / trie.rs
Created August 14, 2017 20:02
use std::fmt::Debug;
use std::fs::File;
use std::io::{BufWriter, Result};
use std::io::prelude::*;
use std::path::Path;
/// A generic case-insensitive Trie map permitting only alphabetical string keys.
pub struct Trie<T> {
values: Vec<T>,
/// An array of twenty-six optional tries, corresponding to each letter of the alphabet.
@rosghub
rosghub / dotfiles
Created May 20, 2017 01:12
Manjaro i3 Hi-DPI config
#
# Configuration files for Manjaro i3 on Lenovo Yoga 2 pro
# to scale properly on HiDPI (3200x1800)
#
#####################################################
~/.profile #
#####################################################
# UI element scaling, icons
export GDK_SCALE=2
@osa1
osa1 / gist:f3585ddab933d15d62d370f8dc4bb91b
Last active February 5, 2019 11:04
vim configure params
# 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/
@mrb
mrb / abstint.md
Last active October 4, 2020 18:45
"Programs that eat programs" Works cited/bibliography
@chrisdone
chrisdone / typing.md
Last active March 22, 2024 23:24
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now