Skip to content

Instantly share code, notes, and snippets.

View akoumjian's full-sized avatar

Alec Koumjian akoumjian

View GitHub Profile
@akoumjian
akoumjian / test_dateparser_tzstring_conversions.py
Created February 9, 2016 04:52 — 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
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)
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)
"camera": {
"index": "analyzed",
"term_vector": "with_positions_offsets",
"type": "string",
"analyzer": "keyword",
"boost": 1.0,
"store": "yes"
}
@akoumjian
akoumjian / Second Test Post Update
Last active December 24, 2015 18:39
Edited by Stardate
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...
person:
user.present:
- uid: 1003
- gid: 1003
- require:
- group: person
group.present:
- gid: 1003
@akoumjian
akoumjian / ruby193.sls
Created July 26, 2013 01:23
Installing ruby193 on ubuntu precise
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
apache2:
pkg:
- installed
service:
- running
- reload: True
- watch:
- file: /etc/apache2/apache2.conf
- file: /etc/apache2/sites-available/phabricator.conf
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
ruby_alternative:
rbenv-deps:
pkg.installed:
- pkgs:
- git
ruby-1.9.3-p429:
rbenv.installed:
- default: True
- require:
- pkg: rbenv-deps
vagrant@precise64:~$ sudo service syslog-ng restart
* Stopping system logging syslog-ng [ OK ]
* Starting system logging syslog-ng Multiple internal() sources were detected, this is not possible;
Error initializing source driver; source='s_all', id='s_all#0'
Error initializing message pipeline;