Skip to content

Instantly share code, notes, and snippets.

View geordee's full-sized avatar
🔥

Geordee Naliyath geordee

🔥
View GitHub Profile
#!/usr/bin/env python
import tweepy
from collections import Counter
consumer_key = 'consumer_key'
consumer_secret = 'consumer_secret'
access_token = 'access_token'
access_token_secret = 'access_token_secret'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@geordee
geordee / elasticsearch.rake
Created July 8, 2014 05:05
Elasticsearch Schema Definition
namespace :elasticsearch do
desc 'Setup Elasticsearch index and mappings'
task :setup do
load('db/elasticsearch.rb')
end
end
@geordee
geordee / es_ngram_analyzer.sh
Last active August 29, 2015 14:03
Elasticsearch nGram Analyzer
curl -XDELETE 'http://localhost:9200/alien'
curl -XPUT "http://localhost:9200/alien" -d'
{
"settings": {
"analysis": {
"filter": {
"index_ngram_filter": {
"type": "edgeNGram",
"min_gram": 2,
@geordee
geordee / Gemfile
Created June 10, 2014 20:28
Rails 4 OmniAuth using Devise with Twitter, Facebook and Linkedin
gem 'devise'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-linkedin'
@geordee
geordee / styles.less
Created April 11, 2014 08:33 — forked from staydecent/styles.less
Compact Tab Bar for Atom Editor
.tab-bar {
height: 32px;
padding: 0;
.tab {
-webkit-transform: none;
top: 1px;
left: 2px;
line-height: 25px;
# Assumptions:
* Rails 3.2.x
* nginx
* capistrano deploy
* "X-Accel-Mapping header missing" messages in nginx error.log file
* You want to serve static files with nginx instead of Rails
# nginx configuration:
@geordee
geordee / generic_datatable.rb
Created February 23, 2014 16:54
A generic data table class to support rendering DataTables from remote. Most of the code from RailsCasts #340 (http://railscasts.com/episodes/340-datatables). Inherit this class and override the columns, records and data methods.
class GenericDatatable
delegate :params, :h, :link_to, :raw, to: :@view
def initialize(view, records)
@view = view
@records = records
end
def as_json(options = {})
{