{{ message }}

Instantly share code, notes, and snippets.

# Oleg Tsybulskyi alogic0

• Odessa, Ukraine
Created Jan 19, 2021
Solution for math problem
View GirardNewton.hs
 -- Haskell version of formulae from -- https://youtu.be/4FNCIYD8HdA import Control.Monad (join) import Data.Ratio oneS :: [Rational] oneS = join \$ repeat [1, (-1)] pSum :: Int -> Rational
Created Jun 17, 2019
Exchange "to" and "from" parameters in a URL to booking.uz.gov.ua
View exchange_to_from.pl
 #!/usr/bin/perl ## Usage: \$0 'https://booking.uz.gov.ua/ru/?time=00%3A00&url=train-wagons&date=2019-08-01&from=2218020&wagon_type_id=%D0%9F&train=058%D0%9B&to=2208001' use v5.14; use strict; use warnings; say \$ARGV[0]; \$_=\$ARGV[0]; chomp;
Last active May 12, 2019
Some git recipes, tips and how-tos.
View git-tips.md

If you want to list all the files currently being tracked under the branch master, you could use this command:

```git ls-tree -r master --name-only
If you want a list of files that ever existed (i.e. including deleted files):```
`git log --pretty=format: --name-only --diff-filter=A | sort - | sed '/^\$/d'`
Created Apr 28, 2019
Full moon dates
View full_moon.sh
 #!/bin/bash moon_ar=(19 17 17 15 14 14 12 12); c=0; for i in {05..12}; do LC_TIME=ru_UA.UTF-8 date -d "2019-\${i}-\${moon_ar[\$c]}" +'%B %d %a'; c=\$((\$c+1)); done \ | sed -E 's/(.+)/\L\1/; s/^(\w)/\U\1/; s/^(\w+)ая /\1ай /; s/^(\w+)я /\1ь /; s/^(\w+)а /\1 /'
Last active Jan 10, 2019
error message from a yii site
View gasolina.html

Phasolina\PhasolinaException: Unknown error in /home/gasonline/www/vendor/gasolina/phasolina/src/Phasolina.php:242
Stack trace:
#0 /home/gasonline/www/frontend/components/User.php(132): Phasolina\Phasolina->request(Object(Phasolina\Endpoint\CityAccountGetRequest))
#2 /home/gasonline/www/frontend/components/User.php(28): frontend\components\User->renewAuthStatus()
#3 /home/gasonline/www/vendor/yiisoft/yii2/web/User.php(351): frontend\components\User->getIdentity()
#4 /home/gasonline/www/vendor/yiisoft/yii2/base/Component.php(130): yii\web\User->getIsGuest()
#5 /home/gasonline/www/frontend/components/View.php(49): yii\base\Component->__get('isGuest')
Last active Aug 11, 2018
Вывод кириллицы в GHCi
View Cyrillic_in_GHCi.md

## Вывод кириллицы в GHCi

Для того, чтобы в консоли GHCi нормально отображалась кириллица, можно сделать следующее (при условии, что установлена Haskell Platform):

Установить пакет wl-pprint:

`cabal install wl-pprint`

Last active Aug 17, 2018
Using regex-applicative for renaming files
View rn-video.hs
 module Main where import Text.Regex.Applicative import Text.Regex.Applicative.Common import System.Environment import Control.Monad.State -- transformation example: "4_CAM 6_main_20180801101345_20180801101432.avi" -- --> "20180801101345_20180801101432_4_CAM_6.avi" -- or: "5_IPC_main_20160807164154_20160807164247.avi"
Created Jul 24, 2018
SQL lessons
View 1.sql
 -- https://www.w3schools.com/sql/trysql.asp CREATE TABLE Countries( ID int IDENTITY(1,1) PRIMARY KEY, Country varchar(255), Continent varchar(255) ); INSERT INTO Countries (Country) SELECT DISTINCT Country FROM Customers;
Last active Jul 21, 2018
PHP examples
View 1.php
 // http://sandbox.onlinephpfunctions.com/code/d1983f5ae45977a035bfb54a9d8782c74c69833c
Created Jul 10, 2018
sinus & cosinus
View sinPlot.hs
 program = drawingOf(sinPlot & cosPlot & coordinatePlane) rmax = 2 * 180 k = rmax / 10 ymax = 5 sinPlot = trigLine sin cosPlot = trigLine cos trigLine f = curve([(x, y) | p <- [-10 .. 10], d <- [0 .. 9], let x = p + d/10, let y = ymax * f (x * k)])