This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def gen_permutation(string): | |
| if len(string) == 1: | |
| yield string | |
| for char in string: | |
| rest = string.replace(char, "") | |
| for p_string in gen_permutation(rest): | |
| yield char + p_string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # copy from easy_thumbnails | |
| from PIL import Image, ImageChops | |
| def is_transparent(image): | |
| """ | |
| Check to see if an image is transparent. | |
| """ | |
| if not isinstance(image, Image.Image): | |
| # Can only deal with PIL images, fall back to the assumption that that | |
| # it's not transparent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function(){ | |
| var threadNames = []; | |
| $('th').each(function(i){ | |
| threadNames.push($(this).html()); | |
| }); | |
| var style = document.createElement('style'); | |
| style.type = 'text/css'; | |
| style.innerHTML = "@media "+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme", | |
| "font_size": 14, | |
| "ignored_packages": | |
| [ | |
| "Vintage" | |
| ], | |
| "theme": "Spacegray.sublime-theme", | |
| "translate_tabs_to_spaces": true, | |
| "update_check": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }, | |
| { "keys": ["ctrl+up"], "command": "swap_line_up" }, | |
| { "keys": ["ctrl+down"], "command": "swap_line_down" }, | |
| { "keys": ["ctrl+alt+l"], "command": "beautify" }, | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| Usage: | |
| app.addRoute("/user/<userid>/", function(){ | |
| console.log("userid:", this.userid); | |
| }).addRoute("/post/<postid>/", function(){ | |
| console.log("postid:", this.postid); | |
| }).addRoute("/post/<postid>/comments", function(){ | |
| console.log("comment of post"); | |
| }) | |
| app.startMain("/user/1/"); // >>> userid: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .yue { | |
| font: 400 18px/1.62 "Georgia", "Xin Gothic", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft YaHei", "SimSun", sans-serif; | |
| color: #333332; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Redressed: [https://www.google.com/fonts/specimen/Redressed](https://www.google.com/fonts/specimen/Redressed) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ngrok: https://ngrok.com/ # Introspected tunnels to localhost | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution(object): | |
| def invertTree(self, root): | |
| """ | |
| :type root: TreeNode | |
| :rtype: TreeNode | |
| """ | |
| if root is None: | |
| return root | |
| if root.left: |
OlderNewer