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 is_palindrome(word): | |
| # should round down | |
| limit = len(word) / 2 | |
| for i in xrange(limit): | |
| if word[i] != word[limit - i - 1]: | |
| return False | |
| return True | |
| def find_splits(word): | |
| if is_palindrome(word): |
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 print_diag(matrix): | |
| h = len(matrix) | |
| w = len(matrix[0]) | |
| x = 0 | |
| y = 0 | |
| anchor = 0 | |
| while True: | |
| if x >= w or y < 0: | |
| anchor += 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
| var assert = require('chai').assert; | |
| var status = require('http-status'); | |
| var app = require('../server/server'); | |
| var request = require('supertest'); | |
| var boot = require('loopback-boot'); | |
| var DataSource = require('loopback-datasource-juggler').DataSource; | |
| request = request('http://0.0.0.0:3000/api'); | |
| describe('Metrics resource', function() { |
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
| { | |
| "always_show_minimap_viewport": true, | |
| "auto_complete_triggers": | |
| [ | |
| { | |
| "characters": "<", | |
| "selector": "text.html" | |
| }, | |
| { | |
| "characters": ".", |
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
| justin@arrakis:~ $ curl -L -A "Googlebot/2.1 (+http://www.google.com/bot.html)" http://www.jamespgannon.com | |
| justin@arrakis:~ $ curl -L -A "justin" http://www.jamespgannon.com | |
| <!DOCTYPE html> | |
| <!--[if IE 7]> | |
| <html class="ie ie7" lang="en-US"> | |
| <![endif]--> | |
| <!--[if IE 8]> | |
| <html class="ie ie8" lang="en-US"> | |
| <![endif]--> |
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 Person: | |
| def __init__(self, name): | |
| self.name = name | |
| def get_name(self): | |
| return self.name; | |
| p = Person('justin') | |
| print('p\'s name is {}.'.format(p.get_name())) |