Skip to content

Instantly share code, notes, and snippets.

View BrianHicks's full-sized avatar

Brian Hicks BrianHicks

View GitHub Profile
>>> def ints1(lst):
... return [int(x) for x in lst if x.isdigit()]
...
>>> def ints2(lst):
... out = []
... for item in lst:
... try:
... out.append(int(item))
... except ValueError:
... pass
@BrianHicks
BrianHicks / cpython.py
Created December 18, 2014 14:05
averages
Python 2.7.8 (default, Nov 14 2014, 15:57:55)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def avg1(nums):
... return sum(nums) / float(len(nums))
...
>>> def avg2(nums):
... count, tot = 0, 0
... for num in nums:
... count += 1
<h1>Hello!</h1>
== <%= @test %> ==
>>> words = open('/usr/share/dict/words', 'r').read().lower().split()
>>> [word for word in words if 'idiot' in word]
['aspidiotus', 'idiot', 'idiotcy', 'idiothalamous', 'idiothermous', 'idiothermy', 'idiotic', 'idiotical', 'idiotically', 'idioticalness', 'idioticon', 'idiotish', 'idiotism', 'idiotize', 'idiotropian', 'idiotry', 'idiotype', 'idiotypic']
;; this file not part of emacs or whatever
(defun xah-syntax-color-hex ()
"Syntax color hex color spec such as 「#ff1100」 in current buffer."
(interactive)
(font-lock-add-keywords
nil
'(("#[abcdef[:digit:]]\\{6\\}"
(0 (put-text-property
(match-beginning 0)
(match-end 0)
2015-03-25 16:43:52
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode):
"Scala Presentation Compiler []" #53 daemon prio=5 os_prio=31 tid=0x00007fd7341c3800 nid=0x9303 in Object.wait() [0x00000001a4562000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:502)
at scala.tools.nsc.util.WorkScheduler.waitForMoreWork(WorkScheduler.scala:16)
- locked <0x00000001516e7ac8> (a scala.tools.nsc.util.WorkScheduler)
at scala.tools.nsc.interactive.PresentationCompilerThread$$anonfun$run$1.apply$mcZ$sp(PresentationCompilerThread.scala:21)
Debugger entered--Lisp error: (quit)
string-match("\\(\\([[:lower:]_[:upper:]\\$]\\([_]??[[:lower:][:upper:]\\$0-9]+\\)*\\(_+[#:<=>@!%&*+/?\\\\^|~-]+\\|_\\)?\\)\\|[#:<=>@!%&*+/?\\\\^|~-]+\\)\\'" "/collect/?tag=impression&guid=f367bb93950dec44bb3efa375f331bb1035a6589&r")
(if (string-match (concat scala-syntax:plainid-re "\\'") s) (match-string 1 s) "")
(let ((s (buffer-substring-no-properties i (point)))) (if (string-match (concat scala-syntax:plainid-re "\\'") s) (match-string 1 s) ""))
(let ((i (point))) (while (and (> i 1) (string-match ensime--prefix-char-class (char-to-string (char-before i)))) (setq i (1- i))) (let ((s (buffer-substring-no-properties i (point)))) (if (string-match (concat scala-syntax:plainid-re "\\'") s) (match-string 1 s) "")))
(progn (let ((i (point))) (while (and (> i 1) (string-match ensime--prefix-char-class (char-to-string (char-before i)))) (setq i (1- i))) (let ((s (buffer-substring-no-properties i (point)))) (if (string-match (concat scala-syntax:plainid-re "\\'") s)
;; this file not part of emacs or whatever
(defun xah-syntax-color-hex ()
"Syntax color hex color spec such as 「#ff1100」 in current buffer."
(interactive)
(font-lock-add-keywords
nil
'(("#[abcdef[:digit:]]\\{6\\}"
(0 (put-text-property
(match-beginning 0)
(match-end 0)

What I do

Make sure NetworkManager and dnsmasq are installed and configured to work together via an Ansible role.

What I expect

I expect that NetworkManager will start dnsmasq on restart after seeing a new configuration option and that the dnsmasq process is not running.

What actually happens

;; prodigy
;; examples: https://github.com/rejeep/prodigy.el#examples
(prodigy-define-service
:name "ZooKeeper"
:command "zkServer"
:args '("start-foreground")
:tags '(db zookeeper)
:kill-signal 'sigkill)
(prodigy-define-service