This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val printBaseDirectory: TaskKey[Unit] = TaskKey[Unit]("printBaseDirectory", "Print baseDirectory for the project", KeyRanks.ATask) | |
printBaseDirectory := { | |
Tasks.printBaseDirectory(streams.value, baseDirectory.value) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var firstArr = [{someProp: 1},{someProp: 2}]; | |
var secondArr = [{someProp: 2},{someProp: 4}]; | |
var isThereEquals = firstArr.some(function (item) { | |
return secondArr.some(function (other) { | |
return other.someProp === item.someProp; | |
}) | |
}); | |
// this will be true because | |
// in the both arrays there is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Пик Бръмбaрът".split("").reduceRight((a,b) => a.concat(b) , ''); | |
// търaбмърБ киП |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <limits> | |
using namespace std; | |
#define MINIMUM_SIZE 2 | |
#define MAXIMUM_SIZE 125 | |
void dumpArray(double input[], int inputSize) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function print_usage () { | |
echo usage: $0 LAST_KNOWN_GOOD_REVISION '"TEST_COMMAND"' | |
echo LAST_KNOWN_GOOD_REVISION = you can specify this as sha1 hash | |
echo TEST_COMMAND = the script to run, it should return 0 if success | |
echo NOTE: Ensure that the current revision is the bad \(broken\) | |
exit 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.streamOne = Bacon.fromBinder(function (sink) { | |
sink(new Bacon.Next()); | |
}).filter(function () { | |
return sessionStorage.getItem('somethingExist') !== null && sessionStorage.getItem('somethingExist') === 'true'; | |
}).toProperty(); | |
// I noticed that it not works at all when I missed this | |
// The question is why? :( | |
this.streamOne.onValue(function () { | |
sessionStorage.removeItem('somethingExist'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/ui-lightness/jquery-ui.css" /> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.3.min.js"></script> | |
<script type="text/javascript" src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> | |
<style type="text/css"> | |
.content .container-project{ | |
border:1px solid blue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ printf 'Shame on me! \nSo far I didn'\''t know about the existence of this package.\nIt contains many example functions and usefull references and can be installed with\nsudo apt-get install bash-doc.\n\n' | |
Shame on me! | |
So far I didn't know about the existence of this package. | |
It contains many example functions and usefull references and can be installed with | |
sudo apt-get install bash-doc. | |
+ apt-cache show bash-doc | |
Package: bash-doc | |
Architecture: all | |
Version: 4.3-14ubuntu1.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Until now I didn't know about this. | |
// We can change name of destructed | |
// variable or function. | |
const {first: third, second: fourth } = { | |
first: () => console.log('first'), | |
second: () => console.log('second') | |
} | |
third() | |
fourth() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($i in Get-ChildItem -Recurse) { | |
if ($i.PSIsContainer) { | |
continue | |
} | |
$dest = $i.Fullname.Replace($PWD, "converted_files") | |
if (!(Test-Path $(Split-Path $dest -Parent))) { | |
New-Item $(Split-Path $dest -Parent) -type Directory | |
} |