Skip to content

Instantly share code, notes, and snippets.

@cemo
cemo / tc-check.py
Last active August 29, 2015 14:19 — forked from canerbasaran/tc-check.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Caner BASARAN
# Licensed under the GNU General Public License, version 2.
# See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
def turkish_id_no_check(tc_no):
''' turkish_id_no_check(long) -> bool
@cemo
cemo / nginx.conf
Last active August 29, 2015 14:19 — forked from oroce/nginx.conf
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
@cemo
cemo / LoggerFilter
Last active August 29, 2015 14:16 — forked from calo81/LoggerFilter
package com.paddypower.financials.market.management.rest.logging;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@cemo
cemo / ssl.rules
Last active August 29, 2015 14:16 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@cemo
cemo / main.yml
Last active August 29, 2015 14:13 — forked from rothgar/main.yml
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

brew install go
mkdir $HOME/go
echo -e "
export GOPATH=$HOME/go
export GOROOT=$(go env GOROOT)
export PATH=$PATH:$GOPATH/bin:$GOROOT/bin" >> $HOME/.bash_profile
brew install hg
source $HOME/.bash_profile
go get code.google.com/p/go.tools/cmd/godoc
go get code.google.com/p/go.tools/cmd/vet
package labs;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.stream.Collectors;
This is a list of tweaks to make IntelliJ IDEA work better with OpenJDK 8 (64-bit). Refer to https://docs.oracle.com/javase/8/docs/technotes/guides/2d/flags.html for the details of the options used below.
Note that, the performance boost achieved via the OpenGL-based pipeline is made possible by using the latest version (e.g., mesa-dri-drivers-10.3.2-1.20141028.fc21.x86_64) of the open-source Radeon driver (for ATi graphics cards). This might vary based on the types of graphics cards and drivers.
1. Text Anti-aliasing
In $IDEA_HOME/bin/idea64.vmoptions, change
-Dawt.useSystemAAFontSettings=lcd
input {
stdin { }
file {
type => "applogs"
# Wildcards work, here :)
path => [ "/home/alee/workspaces/java-workspaces/elasticsearch-example/graph-presenter/logs/*.log" ]
}
}