This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :elasticsearch do | |
desc 'Setup Elasticsearch index and mappings' | |
task :setup do | |
load('db/elasticsearch.rb') | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE 'http://localhost:9200/alien' | |
curl -XPUT "http://localhost:9200/alien" -d' | |
{ | |
"settings": { | |
"analysis": { | |
"filter": { | |
"index_ngram_filter": { | |
"type": "edgeNGram", | |
"min_gram": 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'devise' | |
gem 'omniauth' | |
gem 'omniauth-twitter' | |
gem 'omniauth-facebook' | |
gem 'omniauth-linkedin' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tab-bar { | |
height: 32px; | |
padding: 0; | |
.tab { | |
-webkit-transform: none; | |
top: 1px; | |
left: 2px; | |
line-height: 25px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GenericDatatable | |
delegate :params, :h, :link_to, :raw, to: :@view | |
def initialize(view, records) | |
@view = view | |
@records = records | |
end | |
def as_json(options = {}) | |
{ |
NewerOlder