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
Hey! | |
This is a poll about VMs for Perl 6. It would be awesome if you fill it, | |
just write a comment with your answers. | |
I need it because I work on a huge summary (including, among the others, statistics, tests) | |
of VMs and Perl 6 itself. | |
Thank you very much in advance! | |
sergot |
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
perl6-m -e 'Supply.merge(Supply.interval(2).map({ "tick" }), Supply.interval(2, 1).map({ "tock" })).tap(&say); sleep 10;' | |
tick | |
tock | |
tick | |
tock | |
tick | |
tock | |
tick | |
tock | |
tick |
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/bin/env python3.2 | |
import subprocess, re | |
matchers = { | |
'../scripts/public-add': re.compile('[AM]\tpublic/[\w.]'), | |
'../scripts/public-del': re.compile('D\tpublic/[\w.]'), | |
} | |
for line in subprocess.check_output(["git", "show", "--name-status"]).decode().split('\n')[4:-1]: |
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
# remove this to get an output from this again. | |
use trace; | |
do { | |
# putting a "use trace" into this block will | |
# give a trace as well as the expected results | |
#use trace; | |
.say for <hello how are you>; |
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
sm = Selmaho() | |
sm.selmaho = smt | |
sm.multi = 1 | |
session.save(sm) | |
print session.query(Selmaho).count() |
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
def query(self, query=None, type=None, valsi=[], gloss=None, | |
rafsi=[], selmaho=None, definition=None, notes=None, | |
regexp=False, like=None): | |
results = [] | |
if query: | |
args = {"gloss": gloss, "valsi": valsi, "rafsi": rafsi, | |
"selmaho": selmaho, "definition": definition, "notes": notes, | |
"regexp": regexp, "type": type} | |
listargs = ["valsi", "rafsi"] |
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 Dancer | |
def description() | |
"is like a beautiful swan, gracefully flying over a lake" | |
end | |
def steps() | |
"⚡→→→→↓↓↓↓←↓→↓←↑↑↑↑→↓←↑Ϟ" | |
end | |
def dance() | |
puts self.WHAT | |
puts "My dance " + self.description |
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 threading | |
import time | |
import subprocess | |
# make the system preload the sound | |
subprocess.Popen(["mplayer", "/home/timo/.drama/drama.ogg", "-ao", "null"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
def prebuffer_image(image): | |
open("/home/timo/Pictures/wallpapers/" + image, "r").read() | |
threading.Thread(target=prebuffer_image, args=("kittenface.jpg",)).start() |
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 City(Base): | |
__tablename__ = "city" | |
name = Column(Unicode(6), primary_key=True) | |
rooms = relationship("Room", backref="city") | |
def __repr__(self): | |
return u'<City "%s" with %d rooms>' % (self.name, len(self.rooms)) | |
class Room(Base): | |
__tablename__ = "room" |
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
if !exists('b:did_flymake') | |
let b:did_flymake = 1 | |
autocmd BufWritePost <buffer> | |
\ call FlyMake('cd %s; export FN="%s"; pylint "$FN"; pep8 "$FN"; pyflakes "$FN"', | |
\ '[^:]*:\([0-9]*\):\%\(.*:\)? \(.*\)', | |
\ '.*:\([0-9]*\):\%\(.*:\)? \(.*\)') | |
autocmd BufWinLeave <buffer> call FlyMakeCloseWindows() | |
endif |
OlderNewer