Skip to content

Instantly share code, notes, and snippets.

View vindex10's full-sized avatar
🦀

vindex10

🦀
View GitHub Profile
# Write a function named "davasaan" (division with all vowels a) which calculates integer
# division by 10. The vowels "eiou" are disallowed as are the slash "/", asterisk "*",
# and period "." characters.
q=lambda f:lambda z:f(f(z))
davasaan=lambda n:q(q(q)(q)(lambda t:t+map(lambda x:x+t[-1]+1,t)))([0,0,0,0,0])[n>>1]
@vindex10
vindex10 / Scope.py
Last active July 14, 2018 21:58
Scoping for Python
class Scope:
""" Implementation of scoping. Use it with `with` statement:
```
with Scope() as s:
s.var = 10
print(s.var)
```
"""
def __init__(self):
# fdisk /dev/sdY
create single partition type 7+bootable partition
# mkfs.ntfs -f /dev/sdY1
# ms-sys -7 /dev/sdY
# mount -o loop win7.iso /mnt/iso
# mount /dev/sdY1 /mnt/usb
# cp -r /mnt/iso/* /mnt/usb/
@vindex10
vindex10 / Makefile
Created May 4, 2017 20:53
Makefile for library building. Automatic header linking.
# Definitions for header autolinking
DEPDIR := .d
$(shell mkdir -p $(DEPDIR) >/dev/null)
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td
COMPILE.c = $(CC) $(DEPFLAGS) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
COMPILE.cc = $(CXX) $(DEPFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
POSTCOMPILE = @mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d && touch $@
# Main part