Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Glassman aglassman

View GitHub Profile
View GreedyHealingSolution.java
package com.gmjm.challenge1.solutions.gitter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gmjm.challenge1.Challenge.Node;
import com.gmjm.challenge1.ChallengeSolution;
@aglassman
aglassman / pythonchallenge_1.py
Last active Dec 24, 2015
Python Challenge #1: My polished soluiton.
View pythonchallenge_1.py
#testing revision 2
import string
l = string.lowercase
trans = string.maketrans(string.letters,l[2:]+l[:2])
string.translate(input,trans)
@aglassman
aglassman / pythonchallenge_0.py
Created Sep 27, 2013
Python Challenge #0: My uber complicated solution to challenge 0.
@aglassman
aglassman / pythonchallenge_1-2.py
Created Oct 3, 2013
Python Challenge #1: A not as cool way.
View pythonchallenge_1-2.py
s="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."
o=""
for x in s:
if ord(x)>=ord('a') and ord(x)<=ord('z'):
o+=chr((ord(x)+2-ord('a'))%26+ord('a'))
else:
o+=x
print o
@aglassman
aglassman / JavaEightTests.java
Created Oct 7, 2013
This class will run a few simple tests using the new Java 8 features 'lambda expressions' and 'Streams'.
View JavaEightTests.java
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.stream.*;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
public class JavaEightTests
{
@aglassman
aglassman / logFinancialHistory.js
Last active Dec 29, 2015
Some Google Apps Script for logging finances in a Google Spreadsheet.
View logFinancialHistory.js
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
View DemoNeo4jConfig.java
package org.gmjm;
import org.neo4j.ogm.session.Session;
import org.neo4j.ogm.session.SessionFactory;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.data.neo4j.config.Neo4jConfiguration;
View SpringDataNeo4jDemoApplication.java
package org.gmjm;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringDataNeo4jDemoApplication {
public static void main(String[] args) {
SpringApplication.run(SpringDataNeo4jDemoApplication.class, args);
View build.gradle
buildscript {
ext {
springBootVersion = '1.3.2.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
View ServiceConfiguration.java
package com.example;
import org.h2.server.web.WebServlet;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ServiceConfiguration {
@Bean
You can’t perform that action at this time.