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
class MyClass: | |
def my_function(self, nice_verbose_variable): | |
some_other_variable = another_fairly_long_function(nice_verbose_variable, | |
"oh look, here's a str" + | |
"ing how great a layou" + | |
"t idea this is!") | |
some_other_variable = another_fairly_long_function( | |
nice_verbose_variable, | |
"oh look, here's a string, how great a layout idea this is!" |
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 OverloadedStrings, RecordWildCards, LambdaCase #-} | |
import Conduit | |
import Data.Conduit | |
import Data.Conduit.Network | |
import qualified Data.ByteString.Char8 as BS | |
import Data.Conduit.TMChan | |
import Text.Printf (printf) | |
import Control.Concurrent.STM | |
import qualified Data.Map as Map |
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 ScopedTypeVariables #-} | |
module Main where | |
import Network ( withSocketsDo, listenOn, PortID(..) ) | |
import Network.Socket ( accept, close, recv, send, Socket ) | |
import Control.Concurrent ( forkIO, threadDelay, ThreadId ) | |
import Control.Concurrent.STM ( atomically | |
, orElse | |
, newTChan | |
, readTChan |
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
#!/usr/local/bin/python3.6 | |
# -*- coding: utf-8 -*- | |
from hypothesis import given, example | |
import hypothesis.strategies as st | |
def linear_search(key, l): | |
"""Given a search key and a list of tuples (key, value), return | |
the first item that matches the key, or None if none match. | |
Example: |
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
#!/usr/local/bin/python3.6 | |
# -*- coding: utf-8 -*- | |
from hypothesis import given, example | |
import hypothesis.strategies as st | |
def decode(l): | |
s = "" | |
for i, c in l: | |
s += i * c | |
return s |
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
1: ~/dot-files/nvim/init.vim | |
2: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/syntax.vim | |
3: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/synload.vim | |
4: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/syncolor.vim | |
5: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/filetype.vim | |
6: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/gui_shim.vim | |
7: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/gzip.vim | |
8: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/health.vim | |
9: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/man.vim | |
10: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/matchit.vim |
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
#!/usr/local/bin/python3.6 | |
# -*- coding: utf-8 -*- | |
from hypothesis import given, example | |
import hypothesis.strategies as st | |
def linear_search(key, l): | |
"""Given a search key and a list of tuples (key, value), return | |
the first item that matches the key, or None if none match. | |
Example: |
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
This demonstrates how to make client side certificates with go | |
First generate the certificates with | |
./makecert.sh test@test.com | |
Run the server in one terminal | |
go run server.go |
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 GeneralizedNewtypeDeriving #-} | |
import Control.Monad.Trans.RWS.Strict | |
import Control.Monad | |
newtype Stitch = Stitch Int | |
deriving (Eq, Ord, Show, Num) | |
type Knitting a = RWS () [Stitch] Stitch a | |
emitRow :: Knitting () |
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
import re | |
from hypothesis import strategies as st, given, assume, note, example | |
from typing import List, Optional | |
def is_balanced(mystr): | |
if len(mystr) % 2 != 0: | |
return False | |
stack = [] |
OlderNewer