Skip to content

Instantly share code, notes, and snippets.

View briedis's full-sized avatar
🪵

Mārtiņš Briedis briedis

🪵
View GitHub Profile
/**
*
* @param {T.LoadMore.Par} par
* @constructor
*/
T.LoadMore = function(par){
this.nextPageUrl = par.nextPageUrl;
this.node = par.node;
this.id = this.node.id;
this.autoLoads = par.autoLoads || 3;
<?php
if (!defined("ROOT")) {
include('config.inc');
include('db.inc');
}
// Section loader
if(isset($_GET['section']) && $_GET['section'] != ''){
include $_GET['section'] . '.php';
}
(function () {
'use strict';
var List = Class({
/**
* @type {Array<string>}
*/
_items: [],
/**
(function(){ // namespace (ignore)
// bez priv var
var Simple = Class(
/**
* @lends {Simple#}
*/
{
__NAME:'Simple',
@briedis
briedis / breezy-all-company-search-v2
Last active June 11, 2018 08:49
Breezy All-Company Wide Search
javascript:(function () {
var search = prompt('Ko meklēt?');
if (!search) {
return;
}
var parsedCompanies = {};
var results = [];
var pendingRequests = 0;
class AwesomeWrongApiWrapper
{
const COMPANIES = [
//
];
private function invalidate()
{
foreach (self::COMPANIES as $companyId) {
Cache::forget($this->getPositionKey($companyId));
@briedis
briedis / CacheInterface.php
Last active August 28, 2024 18:38
Cache interface
<?php
interface CacheInterface
{
/**
* Store a mixed type value in cache for a certain amount of seconds.
* Supported values should be scalar types and arrays.
*
* @param string $key
* @param mixed $value