Skip to content

Instantly share code, notes, and snippets.

View yilinxiong's full-sized avatar
💭
0.0

Mr X yilinxiong

💭
0.0
  • Everywhere
  • Shanghai
View GitHub Profile
def test():
i = [0]
def tt():
a = i + [1]
print a
tt()
print i
test()
#!/usr/bin/env python3
# areq.py
"""Asynchronously get links embedded in multiple pages' HMTL."""
import asyncio
import logging
import re
import sys
from typing import IO
---
- hosts: all
become: yes
become_method: sudo
gather_facts: no
vars:
ansible_ssh_private_key_file: "/home/stack/.ssh/id_rsa"
tasks:
# - name: Check if firewalld package is installed (on RHEL).
# command: yum list installed firewalld
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase
try:
import simplejson as json
except ImportError:
import json
# Fields to reformat output for
from datetime import timedelta
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.proto.errind import RequestTimedOut, SerializationError
from pysnmp.proto.rfc1902 import (
Counter32,
Counter64,
Gauge32,
Integer,
Integer32,
IpAddress,
import asyncio
import aiohttp
import requests
import re
URL = "https://api.github.com/users/cloudflare/repos"
def get_repo_pages():
# -*- coding: utf-8 -*-
import logging
from datetime import datetime
def enable_debug_logger(name=None, file_path=''):
'''
This function is used to enable the logger inside the system modules
such as requests, urllib3 etc when the log level set to DEBUG,
# -*- coding: utf-8 -*-
import pymysql
from libraries.log import get_logger
class SimpleMysql(object):
def __init__(self, host='localhost', port=3306, user='root', password='', database='', timeout=5):
self._hostname = host
# -*- coding: utf-8 -*-
from functools import wraps
def retry(max_retry=3, ex=Exception):
def wrap(f):
@wraps(f)
def decorated(*args, **kwargs):
for _ in xrange(max_retry):

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)