Skip to content

Instantly share code, notes, and snippets.

@korczis
korczis / Surprise
Created Mar 9, 2012
What the heck is listening at port 80?
View Surprise
C:\Users\tkorcak>netstat -b -a
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:80 czh-wk-w7-071:0 LISTENING
[Skype.exe] <---- WTF?
@korczis
korczis / proxy.js
Created Mar 9, 2012 — forked from steadicat/proxy.js
A reverse-proxy for CouchDB written in Node.js
View proxy.js
#!/usr/local/bin/node
var sys = require('sys');
var http = require('http');
var url = require('url');
var PREFIX = '/db/';
var TARGET = 'http://example.cloudant.com';
var PORT = 8001;
@korczis
korczis / gist:3260246
Created Aug 4, 2012
Node.js + Geddy + MongoDB + search (not working)
View gist:3260246
this.index = function (req, resp, params) {
var self = this;
// Limit in params?
var limit = 100; // default limit
if(params.limit) {
limit = parseInt(params.limit);
}
// Offset in params?
@korczis
korczis / pagination_support.js
Created Sep 25, 2012
Ember.PaginationSupport
View pagination_support.js
var get = Ember.get;
/**
@extends Ember.Mixin
Implements common pagination management properties for controllers.
*/
Ember.PaginationSupport = Ember.Mixin.create({
/**
*/
View apollo-aws.rb
#! /usr/bin/env ruby
require 'rubygems'
require 'fog'
require 'fileutils'
require 'yaml'
module Apollo
class AwsConsole
View karel.html
<html><body><div class="webkit-line-gutter-backdrop"></div><table><tbody><tr><td class="webkit-line-number"></td><td class="webkit-line-content"><span class="webkit-html-doctype">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;</span><span class="webkit-html-tag">&lt;html&gt;</span><span class="webkit-html-tag">&lt;head&gt;</span><span class="webkit-html-tag">&lt;META <span class="webkit-html-attribute-name">http-equiv</span>="<span class="webkit-html-attribute-value">Content-Type</span>" <span class="webkit-html-attribute-name">content</span>="<span class="webkit-html-attribute-value">text/html; charset=utf-8</span>"&gt;</span><span class="webkit-html-tag">&lt;/head&gt;</span><span class="webkit-html-tag">&lt;body&gt;</span>
</td></tr><tr><td class="webkit-line-number"></td><td class="webkit-line-content">
</td></tr><tr><td class="webkit-line-number"></td><td class="webkit-line-content">
</td></tr><tr><td class="webkit-line-number"></td><td class="webkit-line-content">
</td></tr><t
View gist:5569602
total 559316
-rw------- 1 korczis korczis 159 Oct 13 2011 Woman Her Sex and Love Life-asin_B004UKE2M8-type_EBOK-v_0.ea
-rw------- 1 korczis korczis 335396 Oct 13 2011 Woman Her Sex and Love Life-asin_B004UKE2M8-type_EBOK-v_0.azw
-rw------- 1 korczis korczis 1891 May 25 2012 Woman Her Sex and Love Life-asin_B004UKE2M8-type_EBOK-v_0.apnx
drwx------ 2 korczis korczis 4096 Oct 3 2011 Web
-rw------- 1 korczis korczis 339 Oct 3 2011 Voltaire s Philosophical Diction-asin_B000SN6J6S-type_EBOK-v_0.phl
-rw------- 1 korczis korczis 176 Oct 3 2011 Voltaire s Philosophical Diction-asin_B000SN6J6S-type_EBOK-v_0.ea
-rw------- 1 korczis korczis 320432 Oct 3 2011 Voltaire s Philosophical Diction-asin_B000SN6J6S-type_EBOK-v_0.azw
-rw------- 1 korczis korczis 1104 Apr 29 2012 Voltaire s Philosophical Diction-asin_B000SN6J6S-type_EBOK-v_0.apnx
drwx------ 2 korczis korczis 4096 Jan 19 15:44 UX
View gist:5587305
===========================================================
REST:
PUT /users/
data = {
username: "korczis",
email: "korczis@gmali.com
}
@korczis
korczis / gist:6057201
Created Jul 22, 2013
FQL query to get all photos of all friends
View gist:6057201
SELECT pid, caption, aid, owner, link, src_big, src_small, created, modified FROM photo WHERE aid IN
(SELECT aid FROM album WHERE owner IN
(SELECT uid2 FROM friend WHERE uid1=me())
)
AND created > 0 ORDER BY created DESC
View gist:6060957
require 'koala'
require 'pp'
# Get the token from https://developers.facebook.com/tools/explorer
OAUTH_TOKEN = "SET_YOUR_TOKEN_HERE"
@api = Koala::Facebook::API.new(OAUTH_TOKEN)
profile = @api.get_object("me")
friends = @api.get_connections("me", "friends")
# puts JSON.pretty_generate(friends)