Skip to content

Instantly share code, notes, and snippets.

View mykhas's full-sized avatar

Mykhaś Kobernyk mykhas

View GitHub Profile
@mykhas
mykhas / languager.php
Created October 11, 2012 09:19
Languager 0.2
<?php
/**
* User: Михась
* Date: 07.10.12
* Time: 13:16
*/
$file = './application/views/admin/addpaymentuser.tpl.tpl';
$lang_file = './application/language/russian/admin_lang.php';
<?php
/**
* User: Михась
* Date: 07.10.12
* Time: 13:16
*/
$file = './application/views/admin/addpaymentuser.tpl';
$lang_file = './application/language/russian/admin_lang.php';
! function (e, t) {
function n(e) {
var t, n, r = O[e] = {};
for (e = e.split(/\s+/), t = 0, n = e.length; n > t; t++) r[e[t]] = !0;
return r
}
function r(e, n, r) {
if (r === t && 1 === e.nodeType) {
var i = "data-" + n.replace(q, "-$1").toLowerCase();
@mykhas
mykhas / Seating-scheme.markdown
Created April 17, 2014 09:48
A Pen by Mykhas' Kobernyk.
@mykhas
mykhas / Recursive-iterator.markdown
Created August 19, 2014 10:22
A Pen by Mykhas' Kobernyk.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css.css">
<title>Halloween</title>
<meta charset="utf-8">
</head>
<body>
<form method="post">
<input type="text" name="name">
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
lucky :: Integral a => a -> String
lucky 7 = "THAT'S SEVEN!"
lucky x = "Not a seven"
factorial :: Integral a => a -> a
factorial 0 = 1
factorial n = n * factorial (n - 1)
addVectors :: Integral a => (a, a) -> (a, a) -> (a, a)
addVectors (x1, y1) (x2, y2) = ((x1 + x2), (y1 + y2))
sum' :: Num a => [a] -> a
sum' xs = case xs of
[] -> 0
(x:xs) -> x + sum' xs
initials :: String -> String -> String -- чому не працює String a => a -> a -> a
initials fn ln = [f] ++ " " ++ [l]
where (f:_) = fn
(l:_) = ln
fibie :: Integral a => a -> a
fibie a = case a of
0 -> 0
1 -> 1
n -> fibie (n - 1) + fibie (n - 2)
maximum' :: Ord a => [a] -> a
maximum' xs = case xs of
[] -> error "It's empty"
[x] -> x