Skip to content

Instantly share code, notes, and snippets.

View seyhunak's full-sized avatar
🏆
Polyglot Programmer

Seyhun Akyürek seyhunak

🏆
Polyglot Programmer
View GitHub Profile
require 'nokogiri'
require 'json'
require 'open-uri'
require 'oauth'
# Exchange your oauth_token and oauth_token_secret for an AccessToken instance.
# https://dev.twitter.com/apps here
def prepare_access_token(oauth_token, oauth_token_secret)
consumer = OAuth::Consumer.new("Consumer key", "Consumer secret",
{ :site => "http://api.twitter.com",
1.upto(100){|n|
(f=1;print"Fizz")if n%3==0
(f=1;print"Buzz")if n%5==0
print n if !f
puts}
@seyhunak
seyhunak / 01. Gemfile
Created December 10, 2012 18:18 — forked from schleg/01. Gemfile
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@seyhunak
seyhunak / 01. Gemfile
Created December 10, 2012 11:54 — forked from schleg/01. Gemfile
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@seyhunak
seyhunak / python_slideshare_api.py
Created October 10, 2012 14:20 — forked from saketkc/python_slideshare_api.py
Python file for slideShare API
import urllib, urllib2
import time
import sha
import sys
import mimetools, mimetypes
from cStringIO import StringIO
from BeautifulSoup import BeautifulSoup
class Callable:
def __init__(self, anycallable):
@seyhunak
seyhunak / foursquare token.rb
Created September 24, 2012 08:53 — forked from jweinstein/foursquare token.rb
foursquare token
access_token = client.get_token( "code" => params[:code], "grant_type" => "authorization_code", "redirect_uri" => redirect_uri, :client_id => Rails.application.config.FOURSQUARE_CLIENT_ID, :client_secret => Rails.application.config.FOURSQUARE_CLIENT_SECRET)
user = User.find(session[:user_id])
user.foursquare_access_token = access_token.token
client = user.get_foursquare_client
foursquare_user = client.user(:self)
@seyhunak
seyhunak / crack.rb
Created September 21, 2012 07:29
sublimetext crack.
# 仅去掉了烦人的提示,足够了。
# 使用说明
# ruby crack.rb "/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2"
# only for build 2210
# coded by hhuai.
#特征码取值
magic_code="\x55\x48\x89\xE5\x53\x48\x83\xEC\x08\x80\x3D\x10\x56\x51\x00\x00\x75\x70\xE8\x09\x7B\xF1\xFF\x48\x89\xC3\x48\x89\xD8\x48\x2B\x05\xC4\x17\x51\x00\x48\x3D\x80\xCB\xA4\x00\x7C\x56\xFF\x05\xBE\x17\x51\x00\xE8\xB7\xE7\x2C\x00\x8B\x0D\xB3\x17\x51\x00\x83\xF9\x02\x0F\x9F\xC2\xA8\x0F\x0F\x94\xC0\x84\xC2\x75\x05\x83\xF9\x08\x7E\x31\xC7\x05\x95\x17\x51\x00\x00\x00\x00\x00\x48\x89\x1D\x86\x17\x51\x00\x31\xFF\x48\x8D\x35\x9D\xC8\x3B\x00\x48\x8D\x15\x6B\xC9"
crack_code="\x55\x48\x89\xE5\x53\x48\x83\xEC\x08\x80\x3D\x10\x56\x51\x00\x00\x74\x70\xE8\x09\x7B\xF1\xFF\x48\x89\xC3\x48\x89\xD8\x48\x2B\x05\xC4\x17\x51\x00\x48\x3D\x80\xCB\xA4\x00\x7C\x56\xFF\x05\xBE\x17\x51\x00\xE8\xB7\xE7\x2C\x00\x8B\x0D\xB3\x17\x51\x00\x83\xF9\x02\x0F\x9F\xC2\xA8\x0F\x0F\x94\xC0\x84\xC2\x75\x05\x83\xF9\x08\x7E\x31\xC7\x05\x95\x17\x51\x00\x00\x00\x00\x00\x48\x89\x1D\x86\x17\x51\x00\x31\
@seyhunak
seyhunak / securing_rails_updates.md
Created September 16, 2012 14:48 — forked from peternixey/securing_rails_updates.md
How Homakov hacked GitHub and how to protect your application by Peter Nixey

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.

If you'd like to follow me on twitter my handle is @peternixey


@seyhunak
seyhunak / heroku.rake
Created August 28, 2012 12:21 — forked from myronmarston/heroku.rake
Rake task to download a sql dump from a heroku app
namespace :heroku do
def app_name
@app_name ||= Heroku::Command::BaseWithApp.new([]).app
end
def latest_bundle(timeout = 30)
puts "Attempting to get latest bundle..."
get_bundle = lambda do
bundles = Heroku::Command.run('bundles', {})
bundles.sort { |b1, b2| b1[:created_at] <=> b2[:created_at] }
@seyhunak
seyhunak / gist:3479066
Created August 26, 2012 13:11 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt