Skip to content

Instantly share code, notes, and snippets.

View cwetanow's full-sized avatar

Ivan Mladenov cwetanow

  • Sofia, Bulgaria
View GitHub Profile
let captionsForVideo = document.querySelectorAll('div.cue');
let texts=[];
for(let i=0; i<captionsForVideo.length; i++){
texts.push(captionsForVideo[i].innerText);
}
let text = texts.reduce((prev,text)=> prev + ' ' + text);
macros = [...$('.total')[0].children].splice(2, 3).map(el => +el.innerText);
cals = macros[0] * 4 + macros[1] * 9 + macros[2] * 4;
$('.total')[0].children[1].innerText = cals;
goalMacros = [...$('.total')[1].children].splice(2, 3).map(el => +el.innerText);
goalCals = goalMacros[0] * 4 + goalMacros[1] * 9 + goalMacros[2] * 4;
$('.total')[2].children[1].innerText = goalCals - cals;
#include <unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
// TODO:
// - parse max number
// - parse commands
// execute commands
// int main(int argc, char **argv)
// Package Microsoft.AspNetCore.Cryptography.KeyDerivation
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
using System;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
namespace ConsoleApp1
{
public class PasswordHasher
scanf("%c %d[^\n]%",&operation, &number);
// in use
this.messageService.create('common_modal_confirm_delete', {}, 'common_button_confirm', true, "common_button_cancel")
.subscribe(result => {
result
.subscribe(() => {
this.applicant = undefined;
this.representative = undefined;
this.modelService.remove();
this.loadModel();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
alert('hello')
@cwetanow
cwetanow / db
Created May 16, 2017 04:56
dbscript
USE [master]
GO
/****** Object: Database [TrainingLogs] Script Date: 16-May-17 07:55:55 ******/
CREATE DATABASE [TrainingLogs]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'TrainingLogs', FILENAME = N'D:\Program Files (x86)\SQL Server 2014\MSSQL12.MSSQLSERVER\MSSQL\DATA\TrainingLogs.mdf' , SIZE = 6336KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'TrainingLogs_log', FILENAME = N'D:\Program Files (x86)\SQL Server 2014\MSSQL12.MSSQLSERVER\MSSQL\DATA\TrainingLogs_log.ldf' , SIZE = 1280KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO