Never Ending Security

It starts all here

NotesIndex: Index of Notes

.Git Notes

  1. HEAD and ORIG_HEAD in Git
  2. How do I used ‘git reset –hard HEAD’ to revert to a previous commit?
  3. Github Cheat Sheet

Functional Prgramming


  1. You Could Have Invented Monads! (And Maybe You Already Have.)

Javascript Notes


  1. JSLint 文档
  2. 理解Javascript的闭包
  3. 学习Javascript闭包(Closure)
  4. undefined与null的区别
  5. Javascript异步编程的4种方法
  6. Javascript编程风格
  7. Javascript继承机制的设计思想
  8. 什么是Event Loop? 阮老师写错了,勿点
  9. A re-introduction to JavaScript (JS Tutorial)
  10. Immediately-Invoked Function Expression (IIFE)
  11. how does work?
  12. MDN JavaScript Guide
  13. Inheritance and the prototype chain
  14. Working with objects
  15. What does the exclamation mark do before the function?
  16. Why do you need to invoke an anonymous function on the same line?
  17. how to stop Javascript forEach?
  18. JavaScript “this” keyword
  19. Principles of Writing Consistent, Idiomatic JavaScript
  20. Airbnb JavaScript Style Guide


  1. Difference between readFile and readFileSync
  2. module.exports vs exports in nodeJS
  3. How do I get started with Node.js
  4. Error handling principles for NodeJS + Express apps
  5. Understanding Error-First Callbacks
  6. Designing Singletons
  7. How require() Actually Works


  1. Lodash
  2. chalk
  3. shelljs


  1. Javascript 最大堆栈数量
  2. Github上有趣的js资料
  3. Debugging Javascript

Miscellaneous Notes

  1. httpbin: HTTP Request & Response Service
  2. Awesome Web Performance Optimization

Python Challenge

Level 0

In [21]: 1<<38
Out[21]: 274877906944

Level 1

# src:

from string import maketrans
ori = 'abcdefghijklmnopqrstuvwxyz'
des = 'cdefghijklmnopqrstuvwxyzab'

tbl = maketrans(ori, des)

text = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. \
        bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. \
        sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."

print text.translate(tbl)

# So, the answer is:
print 'map'.translate(tbl)

# Output:   ocr

Level 2


import requests
import re

rep = requests.get("")
html = rep.text

html = ''.join(html.split()) # strip all newline, tab, space
text = re.findall(r'<!--(.*?)-->', html)[1] # get the second comment
wc = {}

for i in text:
    wc[i] = 1 if i not in wc else wc[i]+1

l = [i for i in wc if wc[i]==1]

# retrive answer in text in order
print ''.join(i for i in text if i in l)
# Output:   equality

Level 3

import requests
import re

rep = requests.get("")
html = rep.text

html = ''.join(html.split()) 
text = re.findall(r'<!--(.*?)-->', html)[0] 

res = re.findall(r'[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]', text)
print ''.join(res) 
# Output:   linkedlist

Level 4

# src:

import urllib2
import re
link = ""
# link = ""
for i in range(400):
    text = urllib2.urlopen(link).read()
    num = re.findall(r"and the next nothing is (\d+)", text)[0]

    link = re.sub('\d+',num, link)
    print num + "\t" + link

# Output:   peak.html

Level 5

# src:

import cPickle as pickle
import urllib2
import re

link = ""

text = urllib2.urlopen(link).read()
data = pickle.loads(text)

for line in data:
    print ''.join(i[0]*i[1] for i in line)

# Output:  channel

Python Notes Collections

Alt text

  1. “我基础学完了,接下来该学点什么”
  2. Python yield 使用浅析 by IBM
  3. Difference between , _ and xx in Python
  4. Python修饰器的函数式编程 | 酷 壳 And Prime on decorators
  5. Python Regular Expression by Google
  6. Python 2.7.6 Glossary
  7. Python Best Practice Patterns
  8. yield keyword explained
  9. Python IAQ by Peter Norvig
  10. Python Useful Tips
  11. python 线程,GIL 和 ctypes
  12. An Introduction to List Comprehensions in Python
  13. Advanced Python Constructs
  14. Python 文本处理 by IBM
  15. Python 代码性能优化技巧 by IBM
  16. 可爱的 Python: Python 中的函数编程 by IBM
  17. args and *kwargs in python explained
  18. Python 内建函数用法
  19. How does zip([iter(s)]n) work in Python
  20. Why Python is Slow: Looking Under the Hood
  21. Bouncing Python’s Generators With a Trampoline
  22. A collection of not-so-obvious Python stuff you should know!
  23. What is the python “with” statement designed for?
  24. Parsing English with 500 lines of Python
  25. Python List Comprehension Vs. Map
  26. Key differences between Python 2.7.x and Python 3.x
  27. What is a Python egg?
  28. The Internal Structure of Python Eggs
  29. is None vs. ==None
  30. Python call function within class
  31. Syntax behind sorted(key=lambda :)
  32. The self variable in python explained
  33. How to retrieve an element from a set without removing it?
  34. How to read aloud Python List Comprehensions?
  35. How collections.defaultdict work
  36. 使用 Python 进行线程编程
  37. What is the difference between @staticmethod and @classmethod in Python?
  38. What is for
  39. 可变的call by reference,不可变的call by value
  40. Why does Python assignment not return a value?
  41. Sort list of list with custom compare function in Python
  42. Useful code which uses reduce() in python
  43. 装饰器与函数式Python
  44. Python Patterns – An Optimization Anecdote
  45. Python threading multiple bash subprocesses?
  46. Any gotchas using unicode_literals in Python 2.6?
  47. Iterators, Generators and Decorators
  48. with 48, Functional Programming in Python


  1. Solving Every Sudoku Puzzle by Peter Norvig
  2. 如何使用Python编写一个Lisp解释器 by Peter Norvig
  3. Python 贪吃蛇
  4. How to write a spell checker
  5. 用 Python 秒掉八皇后问题
  6. 自然语言分词 by Peter Norvig
  7. Algorithm X in 30 lines!
  8. 500 Lines or Less ☆
  9. Hidden features of Python ☆
  10. Are list-comprehensions and functional functions faster than “for loops”?
  11. What’s the difference between these two ways of initializing an array?
  12. Generator Tricks for Systems Programmers by DAVE BEAZLEY
  13. A Curious Course on Coroutines and Concurrency by DAVE BEAZLEY
  14. DAVE BEAZLEY’s Blog
  15. Python Decorator Library
  16. Use curses, dont swear


  1. Python资源#1
  2. Python程序员必知必会的开发者工具 (pydoc, doctest, unittest, trace, profile, timit…)
  3. Ipython Notebook
  4. XKCD Plots in Matplotlib: Going the Whole Way
  5. Django资源
  6. Scipy科学计算
  7. Matplotlib Tutorial
  8. Python常见面试题
  9. Emacs for Python Programming
  10. Python web scraping resource
  11. Powerful network tool: scapy
  12. Bool operator priority
  13. Python Performance Tips
  14. High Performance Python Extensions: Part 1
  15. Example Google Style Python Docstrings
  16. key differences between Python 2.x and Python 3.x
  17. Why isn’t Python very good for functional programming?
  18. Must-watch videos about Python

More actual and/or updated notes can be found on:

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s