Skip to content

Instantly share code, notes, and snippets.

View noff's full-sized avatar

Michael Kechinov noff

  • REES46
View GitHub Profile
@noff
noff / gist:6321451
Last active December 21, 2015 14:39
Daemon for track tweets by keywords
#!/usr/bin/env ruby
root = File.expand_path(File.dirname(__FILE__))
root = File.dirname(root) until File.exists?(File.join(root, 'config'))
Dir.chdir(root)
require File.join(root, "config", "environment")
require 'tweetstream'
@noff
noff / Code
Created September 14, 2013 08:15
Calls to graph_post_search_get have exceeded the rate of 10000 calls per 1 seconds. [HTTP 400]
app_id = "XXX";
app_secret = "YYY";
@oauth = Koala::Facebook::OAuth.new(app_id, app_secret)
app_oauth_token = @oauth.get_app_access_token
graph = Koala::Facebook::API.new(app_oauth_token)
while(true) do
@Override
public SimpleItemItemModel get() {
// Get the transposed rating matrix
// This gives us a map of item IDs to those items' rating vectors
Map<Long, ImmutableSparseVector> itemVectors = getItemVectors();
// Get all items - you might find this useful
LongSortedSet items = LongUtils.packedSet(itemVectors.keySet());
// Map items to vectors of item similarities
@noff
noff / log
Created December 6, 2013 12:10
Order Load (14.1ms) SELECT "orders".* FROM "orders" WHERE "orders"."shop_id" = $1 AND (date >= '2013-12-02 00:00:00.000000' and date <= '2013-12-02 23:59:59.999999') ORDER BY "orders"."date" ASC [["shop_id", 1]]
Item Load (1.4ms) SELECT "items".* FROM "items" INNER JOIN "order_items" ON "items"."id" = "order_items"."item_id" WHERE "order_items"."order_id" = $1 [["order_id", 1445]]
OrderItem Load (1.2ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."item_id" = $1 AND "order_items"."order_id" = 1445 LIMIT 1 [["item_id", 4548]]
Item Load (1.7ms) SELECT "items".* FROM "items" INNER JOIN "order_items" ON "items"."id" = "order_items"."item_id" WHERE "order_items"."order_id" = $1 [["order_id", 1446]]
OrderItem Load (1.1ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."item_id" = $1 AND "order_items"."order_id" = 1446 LIMIT 1 [["item_id", 5391]]
Item Load (1.1ms) SELECT "items".* FROM "items" INNER JOIN "order_items" ON "items"."id" = "order_items"."item_id" WHE
@noff
noff / gist:8124475
Created December 25, 2013 15:59
parse utm's
var source = '';
var medium = '';
var campaign = '';
var q = document.location.search;
q = q.substring(1,q.length);
q = q.split('&');
for(var a in q) {
if (q.hasOwnProperty(a)){
var b = q.split('');
@noff
noff / gist:8705086
Last active August 29, 2015 13:55
Тестовое задание HR
Здравствуйте.
Благодарю за то, что откликнулись на нашу вакансию: http://spb.hh.ru/vacancy/9856893
Попробуйте для начала выполнить небольшое тестовое задание.
Задача:
1. Найти информацию о пяти директорах нашей компании: ФИО, должность, контактная информация (телефон или e-mail).
2. Прислать эту информацию, а также свои ФИО, ссылку на резюме и сопроводительное письмо на e-mail исполнительного директора.
Итого, формат вашего письма:
1,101,5.0
1,102,3.0
1,103,2.5
2,101,2.0
2,102,2.5
2,103,5.0
2,104,2.0
3,101,2.5
3,104,4.0
3,105,4.5
@noff
noff / gist:10111433
Created April 8, 2014 11:22
CSS for Ortmen
.rees46-recommend .recommender-block-title {
width: 248px;
height: 23px;
background: url("/images/special_header.png") no-repeat 0 0;
font-size: 18px;
line-height: 23px;
font-weight: 500;
color: #FFF;
text-align: center;
margin: 15px auto 20px;
@noff
noff / poll-data.json
Last active July 3, 2017 21:50
Demo poll structure
{
"id": 2,
"title": "Feature phone Demo Module",
"description": null,
"questions": [
{
"id": 1,
"start": true,
"input": "radio",
<?php
namespace Rees46\Component;
use CCatalogProduct;
use CFile;
use CModule;
use CCatalogDiscount;
use CCatalogSKU;
use Rees46\Options;