Skip to content

Instantly share code, notes, and snippets.

View ibratoev's full-sized avatar

Ivaylo Bratoev ibratoev

View GitHub Profile
len_NM(L, N, M):- len_NM(L, 0, N, M).
lenght([],0).
lenght([_|T],R):- lenght(T, R1),R is R1+1.
len_NM([], X, N, _):- X >= N.
len_NM([A|L], X, N, M):-
lenght(A, AL),
AL >= M,
{
"definitions": {
"User": {
"properties": {
"email": {
"description": "email for user",
"type": "string"
},
"name": {
"description": "name for user",
@ibratoev
ibratoev / useful_cmds.txt
Created June 29, 2016 18:33
Useful commands
# Great way to check disk usage!
du -ahd2 | gsort -h
@ibratoev
ibratoev / updateTypings.js
Created August 25, 2016 11:58
JS script to update typings
#!/usr/bin/env node
// Script to update typings to their latest versions.
// Note that it should be executed in the folder where typings.json is.
const { exec, execSync } = require('child_process');
const path = require('path');
const typings = require(path.join(process.cwd(), 'typings.json'));
exec('typings ls', (error, _, stderr) => {
if (error) {
/**
* Checks if a book is read.
* @param {string} book - The title of the book.
* @returns {boolean} True if the book is read; false otherwise.
*/
function isRead(book) {
return true;
}
/**
* This is a global variable description.
* @type {number}
*/
var globalVar = 3;
/**
 * @name virtualGlobalVar
 * @description This a virtual global variable.
 * @global
 * @type {string}
 */
/**
 * This is a global const.
 * @constant
 * @default
 */
var GLOBAL_CONST = 42;
/**
 * This is a global function
 * with description on two lines.
 * @param {number} foo - Function's first parameter called 'foo'.
 * @param bar Second parameter. Note that the dash before the description is optional. Type is optional as well.
 * @returns {boolean} Description of the return value.
 */
var globalFunc = function (foo, bar) {
  return true;
}
/**
 * This is an ES6 class.
 */
class ES6Class {
}