Skip to content

Instantly share code, notes, and snippets.

View a-tarasyuk's full-sized avatar
:octocat:

Oleksandr T. a-tarasyuk

:octocat:
View GitHub Profile
{
EnterExpressionEvaluationContext Eval(
Actions, Sema::ExpressionEvaluationContext::ConstantEvaluated,
/*LambdaContextDecl=*/
nullptr,
/*ExprContext=*/
Sema::ExpressionEvaluationContextRecord::EK_Other,
/*ShouldEnter=*/
CK == Sema::ConditionKind::ConstexprIf);
@a-tarasyuk
a-tarasyuk / README.md
Created October 16, 2019 12:43 — forked from robertpainsi/README.md
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
new UglifyJsPlugin({
uglifyOptions: {
compress: {
arrows: false,
booleans: false,
cascade: false,
collapse_vars: false,
comparisons: false,
computed_props: false,
hoist_funs: false,
@a-tarasyuk
a-tarasyuk / Instructions.md
Created June 12, 2018 12:25 — forked from glocore/Instructions.md
Setup React Native on Ubuntu 16.04/16.10

1. Install Node.js

  • Follow the steps given here to install Node.js and NPM.
  • Verify whether NPM is installed by typing npm -v in a terminal window.

2. Install React Native CLI

  • npm install -g react-native-cli

3. Setup Android Development Environment

  • Download and install Android Studio as explained here.
  • Run Android Studio and open the SDK Manager. Under the SDK Platforms tab, check Show Package Details, expand Android 6.0 (Marshmallow) and check the following:
@a-tarasyuk
a-tarasyuk / observer.js
Created July 6, 2017 18:04 — forked from emosher/observer.js
A simple implementation of the Observer pattern in Javascript.
/**
* Observer.js
* This is a program to implement the Observer pattern in JavaScript.
*/
/**
* The Subject "class" constructor.
*/
var Subject = function () {
https://jsfiddle.net/_alexander_/r1tahjqe/3/
function multiply(x, y) {
if (y <= 0) {
return 0;
}
if (y > 0) {
return x + multiply(x, y - 1);
}
}
function reverse(string) {
var len = string.length,
halfIndex = Math.floor(len / 2),
result = string.split(''),
tmp;
for (var i = 0; i < halfIndex; i++) {
tmp = result[len - i - 1];
result[len - i - 1] = result[i];
result[i] = tmp;
function isObject(value) {
return typeof value === 'object' && value !== null;
}
function flatten(data, result = {}, prefix = '') {
return Object
.keys(data)
.reduce(function (result, key) {
const path = prefix ? `${ prefix }.${ key }` : key;
function rand(min, max) {
return Math.floor(Math.random() * max) + min
}
function getRandomValue(list, weight) {
var totalWeight = weight.reduce((p, c) => p + c, 0);
var randomRatio = rand(0, totalWeight);
for (var i = 0; i < list.length; i++) {
if (randomRatio < weight[i]) {