Skip to content

Instantly share code, notes, and snippets.

View tnarek's full-sized avatar

Narek Tumanyan tnarek

View GitHub Profile
@tnarek
tnarek / If.js
Created August 12, 2018 15:41
React `If` component
// @flow
import * as React from "react";
import { Component } from "react";
type Props = {
condition: Boolean,
children: React.Node
};
type State = {};
#include <iostream>
using namespace std;
void one_step(int discs, int from, int to, int &step) {
if (discs > 0) {
one_step(discs - 1, from, 6 - (from + to), step);
step = step - 1;
if (step == 0) {
cout << from << " -> " << to << " " << endl;
}
#include <iostream>
using namespace std;
int fib_rec2(int n, int &prev1, int &prev2) {
if (n < 3) {
prev1 = 1;
prev2 = 0;
return 1;
}
#include <iostream>
using namespace std;
bool palindrome(int a[], int length) {
if (length == 1) {
return true;
}
if (length == 2 && a[0] == a[length - 1]) {
return true;
<?php
echo 'third gist';
?>
<?php
echo 'second gist';
?>
<?php
echo 'sample gist';
?>