Skip to content

Instantly share code, notes, and snippets.

View sils's full-sized avatar

Lasse Schuirmann sils

View GitHub Profile
@sils
sils / coala_output_mockup
Created January 19, 2015 17:16
coala output mockup
TODO
@sils
sils / gist:d7f10c3e07348993975a
Created July 4, 2015 12:38
new bear concept prototype
import inspect
from threading import Thread
from queue import Empty
from multiprocessing import Value
from coalib.misc.Enum import enum
class Result:
def __init__(self, message, file=None, origin=None):
self.message = message
did_nothing = True
yielded_results = False
(sections,
local_bears,
global_bears,
targets) = gather_configuration(interactor.acquire_settings,
log_printer)
if bool(sections["default"].get("show_bears", "False")):
show_bears(local_bears,
lasse@lssteadarch ~/prog/coala (git)-[sils/dep] % ./run_tests.py -t DbusTest
1/1 | DbusTest
test_dbus (__main__.DbusTest) ... Traceback (most recent call last):
File "/home/lasse/prog/coala/coalib/tests/output/dbus/DbusTest.py", line 122, in <module>
create_mainloop()
File "/home/lasse/prog/coala/coalib/tests/output/dbus/DbusTest.py", line 35, in create_mainloop
mainloop.run()
File "/usr/lib/python3.4/site-packages/gi/overrides/GLib.py", line 575, in run
raise KeyboardInterrupt
KeyboardInterrupt
diff --git a/coalib/coala_json.py b/coalib/coala_json.py
index 1b2d7f2..a660b18 100644
--- a/coalib/coala_json.py
+++ b/coalib/coala_json.py
@@ -13,7 +13,7 @@
import json
-from coalib.output.printers.ListLogPrinter import ListLogPrinter
+from coalib.output.printers.ConsolePrinter import ConsolePrinter
@sils
sils / withgraphics.tex
Created July 30, 2015 15:34
generated tex
\documentclass[ignorenonframetext,aspectratio=169]{beamer}
\usetheme{guadec}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{caption label separator}{:}
\setbeamercolor{caption name}{fg=normal text.fg}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\usepackage{lmodern}
\ifxetex
@sils
sils / process-interrupter.py
Last active August 29, 2015 14:26 — forked from Makman2/process-interrupter.py
How to interrupt a process correctly in windows so catch and finally get executed.
from multiprocessing import Process, Queue
from time import sleep
import ctypes
# WINDOWS ONLY!!!
def interrupt_process(pid):
CTRL_C_EVENT = 0x0
ctypes.windll.kernel32.GenerateConsoleCtrlEvent(CTRL_C_EVENT, pid)
# DON'T USE THIS!!! THIS WON'T WORK AND GENERATES A COMPLETELY DIFFERENT
title: What can I do for coala?
description: What can I do for coala?
favicon: https://raw.githubusercontent.com/coala-analyzer/coala-artwork/master/artwork/coala_bear.png
negatives:
- "No"
- Nope, nope, nope
- Nope
- No, thanks
- Not on your life
- Doesn't sound like me
@sils
sils / speakit.py
Created October 3, 2015 21:23
A script for speechless people to give them a voice
from subprocess import PIPE, check_output
import readline
while True:
sentence = input("Type something to speak: ")
check_output("echo \""+sentence+"\" | festival --tts", shell=True)
import re
from coalib.bearlib.languages.documentation.DocstyleDefinition import (
DocstyleDefinition)
from coalib.bearlib.languages.documentation.DocumentationComment import (
DocumentationComment)
from coalib.results.TextRange import TextRange
# Used to break out of outer loops via exception raise.