Skip to content

Instantly share code, notes, and snippets.

View evilbloodydemon's full-sized avatar

Igor Fomin evilbloodydemon

View GitHub Profile
// ==UserScript==
// @name Kinopoisk-Torronto
// @namespace http://torronto.evilbloodydemon.ru/
// @version 0.1
// @description Кнопка перехода на торронту для кинопоиска
// @author Igor Fomin
// @match http://www.kinopoisk.ru/film/*
// @grant none
// ==/UserScript==
//subquery
private void UpdateBestVideoQuality(DbTorronto db, Movie movie)
{
db.Movie
.Where(m => m.ID == movie.ID)
.Set(f => f.BestVideoQuality, m => db.Torrent
.Where(t => t.MovieID == m.ID)
.Select(t => t.VideoQuality)
.Max())
//---------------------------------------------------------------------------------------------------
// This code was generated by LinqToDB.
//---------------------------------------------------------------------------------------------------
using System;
using System.Linq.Expressions;
using NUnit.Framework;
namespace Torronto.BLL
{
public async Task<string> Get(int id)
{
using (var conn = new RedisConnection("localhost"))
{
await conn.Open();
var channel = conn.GetOpenSubscriberChannel();
try
{
var result = string.Empty;
public async Task<string> Get(int id)
{
using (var conn = new RedisConnection("localhost"))
{
await conn.Open();
try
{
var value = await conn.Lists.BlockingRemoveFirstString(1, new[] {id.ToString()}, 10);
return value.Item1 + " -> " + value.Item2;
/// <reference path="_common.ts" />
module Devices {
export class Device {
constructor(
public ID: number,
public DeviceType: string,
public Vendor: string,
public Model: string,
public Platform: string
val DB_VERSION = 5;
[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class PillSQLiteHelper(context: Context) :
SQLiteOpenHelper(context, "pills_db", null, DB_VERSION) {
val migrations: Map<Int, String> = mapOf(
1 to """
CREATE TABLE pills (
_id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
@evilbloodydemon
evilbloodydemon / flat.php
Created August 22, 2012 17:05
flatten array
<?php
$data = array(
"Declarant" => array(
"Governance" => array(
"Name" => "Tommy",
"LastName" => "Vercetti"
),
),
'a' => array(
@evilbloodydemon
evilbloodydemon / AllAppTest.php
Created August 5, 2012 05:54 — forked from jrbasso/AllAppTest.php
All application tests ignoring CakePHP core files from Code Coverage
<?php
class AllAppTest extends CakeTestSuite {
protected $coverageSetup = false;
public static function suite() {
$suite = new static('All Application Tests');
$suite->addTestDirectoryRecursive(__DIR__);
return $suite;
@evilbloodydemon
evilbloodydemon / profile.js
Created May 14, 2012 05:38
knockout view model
var MassVM = app.Class.extend({
init: function() {
this._fields = [
'lastPaid',
'paymentPeriod',
'lastTrial',
'trialPeriod',
'clickbank',
'paypal',
'notes'