Skip to content

Instantly share code, notes, and snippets.

View meling's full-sized avatar

Hein Meling meling

View GitHub Profile

Keybase proof

I hereby claim:

  • I am meling on github.
  • I am meling (https://keybase.io/meling) on keybase.
  • I have a public key ASBWwcJ9xZf_-TxRcyg8_PizQrbnJExkIye5gh1EO2ADiAo

To claim this, I am signing this object:

@meling
meling / gist:6373bb6a7f6717c3cd9a2b10e483961e
Created October 3, 2017 18:02
Defining template can't access outer context
package main
import "text/template"
import "os"
type address struct {
House string
Street string
PostCode string
Country string
@meling
meling / gist:912b2b905ce43fb42f5a
Created May 20, 2015 09:04
Example to extract with reg.exp.
import re
def ExtractPval(line):
# 2015-04-09 14:15:37,019 com6 INFO <=3.004882812 [CR][LF]
start = line.index('=')+1
stop = line.index('[')-1
return float(line[start:stop])
def main():
f=open('acudump1.txt','r')
import re
#other code...
match = re.search('<=ips tic 2 acu/(ps.+?) value', line)
if match:
key = match.group(1)
nxtLine = f.readline()
value = ExtractPval(nxtLine)
if not data.has_key(key):
@meling
meling / brew doctor output
Created October 31, 2011 10:49
Brew install of sshfs
%% brew doctor
Some "config" scripts were found in your path, but not in system or Homebrew folders.
`./configure` scripts often look for *-config scripts to determine if software packages
are installed, and what additional flags to use when compiling and linking.
Having additional scripts in your path can confuse software installed via Homebrew if
the config script overrides a system or Homebrew provided script of the same name.