View split_word.py
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):
View print_diag.py
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
View test_server.js
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() {
View gist:51c68e85facbb2e5c516
{
"always_show_minimap_viewport": true,
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": ".",
View gist:0b4c1d61369d1e01a987
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]-->
View gist:8499011
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()))