Skip to content

Instantly share code, notes, and snippets.

View buremba's full-sized avatar
🤖
at LiveRamp

Burak Emre Kabakcı buremba

🤖
at LiveRamp
  • LiveRamp
  • London
  • 07:03 (UTC)
  • X @bu7emba
View GitHub Profile
@buremba
buremba / LICENSE.txt
Created November 28, 2011 15:03 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@buremba
buremba / crawler.py
Created October 2, 2012 22:16
python web crawler
import urllib
import urllib2
import MySQLdb
import re
db = MySQLdb.connect(host="localhost",user="root",passwd="[PASS]",db="python")
cursor = db.cursor()
def finda(L, value):
try:
@buremba
buremba / backbone-databinding.js
Created October 23, 2012 01:01
Backbone.js Easy Data-Binding
Backbone.ModelBindedCollection = Backbone.Collection.extend({
initialize: function(data) {
this.view = data.bind;
this.prefix = (data.prefix ? data.prefix : '');
this.on("add", function(model, collection, index) {
if(this.container && this.container instanceof jQuery && this.template) {
this.container.append(_.template(this.template, model.attributes));
}
return (this.view[this.prefix+'_addedModel'] ? this.view[this.prefix+'_addedModel'](model, index.index, collection) : false);
});
@buremba
buremba / crossbrowser.css
Created October 23, 2012 01:15
Cross-browser CSS Prefixes
#lifeinMoon {
padding: 0px 0 20px 40px; /* All browsers see this */
#padding:0px; /* FireFox will not see this but IE7 & IE6 will */
#margin: 20px 0 0 40px; /* FireFox will not see this but IE7 & IE6 will */
_margin: 10px 0 0 30px; /* FireFox and IE7 will not see this but IE6 will */
}
@buremba
buremba / index.json
Created December 28, 2012 02:53
elasticsearch mapping
{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 1,
"index.store.compress.stored" : true
},
"mappings": {
"artist": {
"properties": {
@buremba
buremba / es.sh
Created January 19, 2013 14:42 — forked from sgringwe/es.sh
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
# Download the compiled elasticsearch rather than the source.
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@buremba
buremba / gist:9919584
Created April 1, 2014 18:03
cassandra join operation using spark
val cf1 = actorRDD.map {
case (key, value) => {
val data = value.get("properties")
var ret1: String = null
if(data!=null)
ret1 = ByteBufferUtil.string(data)
(ByteBufferUtil.string( key.get("id")), ret1)

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@buremba
buremba / partialindex.md
Last active August 29, 2015 14:05
hazelcast partial index

#Partial Index Implementation

A partial index is a type of index built over a subset of a map; the subset is defined by a conditional expression (called the predicate of the partial index). The index contains entries for only those table rows that satisfy the predicate. A major motivation for partial indexes is to avoid indexing common values. Since a query searching for a common value (one that accounts for more than a few percent of all the map entries) will not use the index anyway, there is no point in keeping those rows in the index at all. This reduces the size of the index, which will speed up queries that do use the index. It will also speed up many write operations (IMap.put, IMap.set etc.) because the index does not need to be updated in all cases. (benchmarks) [1]

[Wikipedia] (http://en.wikipedia.org/wiki/Partial_index)

[Postgresql] (http://www.postgresql.org/docs/8.0/static/indexes-partial.html)

[In case you may want to look at some related unit tests] (https://github.com/buremb

@buremba
buremba / gist:a005e893fa3bf88f9951
Created February 20, 2015 01:57
most common user agents
["Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0", "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrom