Skip to content

Instantly share code, notes, and snippets.

View chuwy's full-sized avatar

Anton Parkhomenko chuwy

View GitHub Profile
# -*- coding: utf-8 -*-
import os
gettext = lambda s: s
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@chuwy
chuwy / .gitignore
Created June 16, 2012 10:55 — forked from starenka/.gitignore
fabfile to deploy flask app to nginx/supervisor/uwsgi stack
.idea/*
*.pyc
C:\"Program Files"\Oracle\VirtualBox\VBoxManage.exe startvm Ubuntu
timeout 30
net use X: \\chuwy-ubuntu\home /user:user pass
@chuwy
chuwy / node-vens.sh
Created September 14, 2012 05:59
Installing node.js into virtualenv
#!/bin/sh
#
# This script will download NodeJS, NPM and lessc, and install them into you Python
# virtualenv.
#
# Based on a post by Natim:
# http://stackoverflow.com/questions/8986709/how-to-install-lessc-and-nodejs-in-a-python-virtualenv
NODEJS="http://nodejs.org/dist/v0.8.3/node-v0.8.3.tar.gz"
import java.io.{File, PrintWriter}
import org.json4s.jackson.JsonMethods._
def printToFile(f: File)(op: PrintWriter => Unit) {
val p = new java.io.PrintWriter(f)
try { op(p) } finally { p.close() }
}
object jsonGen extends JsonGen
package com.snowplowanalytics.schemaguru.utils;
import java.io.*;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
public class SuperPrinter extends DefaultPrettyPrinter
{
@chuwy
chuwy / Dockerfile
Last active August 29, 2015 14:24
Beanstalk
# Dockerfile
FROM java:7
MAINTAINER Snowplow Analytics, support@snowplowanalytics.com
WORKDIR /
USER daemon
EXPOSE 8000
ADD start.sh /tmp/
CMD ./tmp/start.sh
@chuwy
chuwy / ec2mock.py
Last active September 29, 2015 15:02
Stupid EC2 instance info mock
#!/usr/bin/python3
"""
Stupid EC2 meta data instance mock
Save this file as server.py
>>> python server.py 0.0.0.0 8001
serving on 0.0.0.0:8001
or simply
@chuwy
chuwy / ec2.json
Last active October 1, 2015 12:41
{
"ami-id" : "ami-d05e75b8",
"ami-launch-index" : "0",
"ami-manifest-path" : "(unknown)",
"block-device-mapping" : {
"ami" : "/dev/sda1",
"root" : "/dev/sda1"
},
"hostname" : "ip-172-31-9-37.ec2.internal",
"instance-action" : "none",
{
"meta-data" : {
"ami-id" : "ami-d05e75b8",
"ami-launch-index" : "0",
"ami-manifest-path" : "(unknown)",
"block-device-mapping" : {
"ami" : "/dev/sda1",
"root" : "/dev/sda1"
},
"hostname" : "ip-172-31-9-37.ec2.internal",