Skip to content

Instantly share code, notes, and snippets.

@Nyahua
Nyahua / regex_digits_between_words.md
Created March 27, 2017 23:22
regular expression for 7 digits between special words

I got a wrong log as:

test_string = """
03/27/17 12:55.23something wrong with 20405 post id 450469503/27/17 12:50.55something
wrong with 20302 post id 450180903/27/17 11:41.18something wrong with 18314 
post id 443624203/27/17 11:26.56something wrong with 17922 post id 442210904/27/17 10:48.33
something wrong with 16775 post id 438259104/27/17 10:30.59something 
wrong with 16275 post id 436333705/27/17 
"""
@Nyahua
Nyahua / no_hanghup_run.md
Created March 27, 2017 07:54
How to run the Python program in the background in Ubuntu machine?
@Nyahua
Nyahua / remove_github_repository.md
Created March 27, 2017 07:40
How to remove a directory from git repository ?
@Nyahua
Nyahua / json.dump_vs_dumps.md
Last active March 26, 2017 12:09
What is the difference between json.dumps and json.load? [closed]
@Nyahua
Nyahua / falt_dict.py
Last active March 26, 2017 01:00
flatten embedded children dictionaries in python
# coding: utf-8
# In[31]:
dict_list = [
{'id': 1, 'key1': 'abc'},
{'id': 2, 'key1': 'def', 'key2': 123},
{'id': 3, 'key1': 'ghi', 'key2': 456, 'children': [
{'id': 4, 'key1': 'jkl'},