Skip to content

Instantly share code, notes, and snippets.

create index concurrently idx_test_package_no_hub_id_date
on test (package_no, hub_id, date);
create index concurrently idx_test_date_hub_id_package_no
on test (date, hub_id, package_no);
@erdaldalkiran
erdaldalkiran / long-running-query.sql
Last active February 7, 2021 12:03
long running query
select *
from atable t
where t.package_no='GonderiNo'
and t.hub_id=42
and (t.date between '2021-02-04 21:00:00.000000' and '2021-02-05 21:00:00.000000');
class MyMatcher {
constructor(value) {
this.value = value;
}
[Symbol.match](string) {
var index = string.indexOf(this.value);
if (index === -1) {
return null;
}
return [`${this.value} altered`];
@erdaldalkiran
erdaldalkiran / essence-of-functional-programming.js
Created August 27, 2016 06:41
Bahmutov - Essence of functional programming
//----------------first
// function timedPrint(character, N, interval) {
// var counter = 0;
// var intervalId = setInterval(function () {
// console.log(character);
// counter += 1;
// if (counter >= N) {
// clearInterval(intervalId);
// console.log('done printing', character, N, 'times');
// }
@erdaldalkiran
erdaldalkiran / so-test.js
Last active March 6, 2016 00:10
Unit Testing CycleJs Component with Mocha
//TO RUN TEST:
// mocha --compilers js:babel-core/register FILE-LOCATION/so-test.js
import Rx from 'rx';
import {Observable} from 'rx';
import chai from 'chai';
const expect = chai.expect;
import CycleDOM from '@cycle/dom';
public string Ad
{
get
{
return this._Ad;
}
set
{
if (value != this._Ad)
{