Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View micmmakarov's full-sized avatar

Miša Mаkaröv micmmakarov

View GitHub Profile
@micmmakarov
micmmakarov / Get likes
Created November 11, 2015 17:12
Analyze person's likes to figure out who's the most active
api_key = "https://developers.facebook.com/tools/explorer"
api = Koala::Facebook::API.new(api_key)
profile = api.get_object("me")
profile = _
profile.keys
@micmmakarov
micmmakarov / 4sq.rb
Created September 5, 2012 03:51
Foursquare API using
require 'foursquare2'
require 'pry'
require 'pry-nav'
require 'colorize'
client = Foursquare2::Client.new(:client_id => 'the key', :client_secret => 'the key')
@micmmakarov
micmmakarov / seed_generator
Created August 15, 2012 20:36
Seed generator
def new_lined(text)
13.chr + 10.chr + text + 13.chr + 10.chr
end
posts = Post.all
posts.each do |p|
puts "Post.create(:title => '#{p.title}', :posted_on => '#{p.posted_on}' :author_id => '#{p.author_id}', :created_at => '#{p.created_at}', :updated_at => '#{p.updated_at}', :body => <<EOF"+new_lined(p.body)+"EOF)"
end
@micmmakarov
micmmakarov / twitter_api
Created August 15, 2012 03:52
Find random tweet and then translate it to italian and repost
require 'twitter'
require 'google_translate'
# We using credentials of "Rails School" twitter account
Twitter.configure do |config|
# credentials here!
end
# for translator
@micmmakarov
micmmakarov / helper.coffee
Last active August 29, 2015 14:26
Recursive function to change hash by deep_path
Sonar.changeByArray = (hash, array, newValue) ->
obj = hash
i = 0
while i < array.length - 1
obj = obj[array[i++]]
obj[array[i]] = newValue
@micmmakarov
micmmakarov / magic-input.jsx.js.coffee
Last active August 29, 2015 14:26
Magic input for reactJS, supporting deep path binding
MagicInput = React.createClass
onChange: (e) ->
state = @props.binding[0].state
Sonar.changeByArray state, @path, e.target.value
@props.binding[0].setState state
getValue: ->
value = @props.binding[0].state
@path ||= @props.binding[1].split('.')
require 'pry'
require 'pry-nav'
#CODE IS "RailsSchoolDevelop14"
phones = {
michael: '+1415PUTREALNUMBER'
}
require 'twilio-ruby'