create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # zipdb.py | |
| # Use a zipfile store a dict like k-v database. | |
| # Known bug: duplicate key(filenames) allowed | |
| # | |
| # Copyright 2012 mayli <[email protected]> | |
| # |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
| /* ============================================================================= | |
| CSS Declarations | |
| ========================================================================== */ | |
| /* ==|== The Standard Way =================================================== */ | |
| .foo::before { | |
| /* ...css rules... */ | |
| } |
| import urllib2 | |
| def xiami_decode(s): | |
| s = s.strip() | |
| if not s: | |
| return False | |
| result = [] | |
| line = int(s[0]) | |
| rows = len(s[1:]) / line | |
| extra = len(s[1:]) % line |
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |
| browser = request.user_agent.browser | |
| version = request.user_agent.version and int(request.user_agent.version.split('.')[0]) | |
| platform = request.user_agent.platform | |
| uas = request.user_agent.string | |
| if browser and version: | |
| if (browser == 'msie' and version < 9) \ | |
| or (browser == 'firefox' and version < 4) \ | |
| or (platform == 'android' and browser == 'safari' and version < 534) \ | |
| or (platform == 'iphone' and browser == 'safari' and version < 7000) \ |
This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded that can be called on DOM elements.
Just use the code in index.js in your app or website. You can see usage in the test page test.html.
The parent element will only scroll if the element being called is out of the view. The boolean can force the element to be centered in the scrolling area.
| ar http = require('http'); | |
| var fs = require('fs'); | |
| var util = require('util'); | |
| var fileCache; | |
| var sendFile = function(conn, file) { | |
| conn.writeHead(200, {"Content-Type": "text/html", "Content-Length": file.length}); | |
| conn.write(file); | |
| conn.end(); | |
| } |
| /** | |
| * @application | |
| * @file /app/helpers/models.js | |
| **/ | |
| Spine.Model.extend({ | |
| toJSON: function(){ | |
| var attributes = this.attributes(); | |
| attributes['id'] = attributes['_id']; | |
| return attributes; |