Skip to content

Instantly share code, notes, and snippets.

Alec Koumjian akoumjian

  • Vermont
Block or report user

Report or block akoumjian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@akoumjian
akoumjian / ndjson.md
Last active Jul 17, 2019
Newline delimited JSON Classifier for AWS Glue
View ndjson.md

AWS Glue surpriginsly does not support reading NDJSON out of the box. You have to create a custom classifier, but it is incredibly simple.

Use the pattern $[*] with a custom JSON classifier and it should read the NDJSON schema more or less correctly.

NOTE: Editing classifiers doesn't seem to work well, or they are denormalized in the crawler. Instead, delete and create new classifiers when making adjustments.

View test.py
def testing_ghost_stuff(foo):
return foo**2
@akoumjian
akoumjian / sarama_sasl_ssl.go
Created Mar 13, 2017
Sarama client for Kafka makes it difficult to figure out
View sarama_sasl_ssl.go
// The Kafka documentation makes it very confusing to set up plain text SASL authentication while also using TLS / SSL.
// MAKE SURE THE KEYSTORE YOU ARE USING ON THE KAFKA CLUSTER IS BUILT WITH RSA ALGO, OTHERWISE GO CAN'T TALK TO JAVA OVER TLS / SSL
package main
import (
"crypto/tls"
"fmt"
"github.com/Shopify/sarama"
)
@akoumjian
akoumjian / test_dateparser_tzstring_conversions.py
Created Feb 9, 2016 — forked from ranchodeluxe/test_dateparser_tzstring_conversions.py
An interesting note about how dateparser parses date strings with tzinfo in them; then some expected interpretations of date strings with tzinfo
View test_dateparser_tzstring_conversions.py
import re
import pytz
from datetime import datetime
import dateparser
import pytest
def expected_tz_conversion(datetime_obj, pytz_tzinfo_offset):
# keep the day and time, just give it tzinfo
return pytz_tzinfo_offset.localize(datetime_obj)
View rodney.py
from django.db import models
class ProcessorMake(models.Model):
name = models.CharField(max_length=20)
def __unicode__(self):
return self.name
class ProcessorLine(models.Model):
processormake = models.ForeignKey(ProcessorMake)
View camera_mapping.json
"camera": {
"index": "analyzed",
"term_vector": "with_positions_offsets",
"type": "string",
"analyzer": "keyword",
"boost": 1.0,
"store": "yes"
}
View Second Test Post Update
stardate: 308f5e30-2def-11e3-8c72-68a86d0df4b0
created: 2013-10-05 18:56:00.605395
title: Second Test Post Update
I'm a lumberjack and I'm okay...
View gist:6110204
person:
user.present:
- uid: 1003
- gid: 1003
- require:
- group: person
group.present:
- gid: 1003
@akoumjian
akoumjian / ruby193.sls
Created Jul 26, 2013
Installing ruby193 on ubuntu precise
View ruby193.sls
rubyppa:
pkgrepo.managed:
- name: deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu precise main
- ppa: brightbox/ruby-ng
- file: /etc/apt/sources.list.d/ruby-ng-precise.list
ruby1.9.3:
pkg.installed:
- require:
- pkgrepo: rubyppa
View gist:5940806
apache2:
pkg:
- installed
service:
- running
- reload: True
- watch:
- file: /etc/apache2/apache2.conf
- file: /etc/apache2/sites-available/phabricator.conf
You can’t perform that action at this time.