Skip to content

Instantly share code, notes, and snippets.

View vickumar1981's full-sized avatar

Vic Kumar vickumar1981

View GitHub Profile
@vickumar1981
vickumar1981 / TrailingSlashRequestHandler.scala
Last active September 26, 2018 18:36
trailing request handler
package handlers
import javax.inject.Inject
import play.api.http._
import play.api.mvc._
import play.api.routing.Router
class TrailingSlashRequestHandler @Inject()(router: Router,
errorHandler: HttpErrorHandler,

Scala Style Guidelines

This repository contains style guidelines for writing Scala code.

Whitespace

  • Use two spaces for indentation.
  • Add a newline to the end of every file.
import signal
import sys
import asyncio
import aiohttp
import json
loop = asyncio.get_event_loop()
client = aiohttp.ClientSession(loop=loop)
async def get_json(client, url):
@vickumar1981
vickumar1981 / ocr-test.py
Created October 8, 2017 03:30
ocr text bold example
from PIL import Image
from pytesseract import image_to_string
if __name__ == "__main__":
img = Image.open("license.jpg")
img = img.convert("RGBA")
pixdata = img.load()
# Make the letters bolder for easier recognition
for y in xrange(img.size[1]):
package bootstrap.liftweb
import net.liftweb.common.Loggable
import net.liftweb.util.{LoggingAutoConfigurer, Props}
import org.eclipse.jetty.server.{HttpConfiguration, HttpConnectionFactory, Server, ServerConnector}
import org.eclipse.jetty.webapp.WebAppContext
import scala.util.Properties
object Start extends App with Loggable {
`_____________________________________________________ test_serve_schema ______________________________________________________
def test_serve_schema():
response = client.get('/schema/')
codec = CoreJSONCodec()
> document = codec.decode(response.content)
tests/test_apischema.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib/python3.5/site-packages/coreapi/codecs/corejson.py:306: in decode
> zappa tail
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
[1495490287800] Traceback (most recent call last):
[1495490287800] File "/var/runtime/awslambda/bootstrap.py", line 226, in handle_event_request
[1495490287800] result = request_handler(json_input, context)
[1495490287800] File "/var/task/handler.py", line 484, in lambda_handler
[1495490287800] return LambdaHandler.lambda_handler(event, context)
[1495490287800] File "/var/task/handler.py", line 240, in lambda_handler
[1495490287800] handler = cls()
# Class: cfpb_jenkins
#
#
class cfpb_jenkins (
$mailhost = undef,
) {
include java::openjdk8
include epel
include git
version: "2"
services:
agreement_database:
build: ./docker/apps/agreement_database/
ccdb-content:
build: ./docker/apps/ccdb-content/
college-costs:
build: ./docker/apps/college-costs/
django-college-cost-comparison:
Problem accessing /sessions. Reason:
com.basho.riak.client.core.netty.RiakResponseException: Error processing incoming message: error:function_clause:[{riak_index,
parse_binary,
[{struct,
[{<<"value">>,
<<"dHJ1ZQ==">>}]}],
[{file,
"src/riak_index.erl"},
{line,535}]},