Skip to content

Instantly share code, notes, and snippets.

View romanitalian's full-sized avatar
🎯
Focusing

roman romadin romanitalian

🎯
Focusing
View GitHub Profile
@romanitalian
romanitalian / bubble.php
Created May 12, 2020 16:28 — forked from PedroEscudero/bubble.php
Bubble script for testing speed of PHP-8
<?php
function bubble_sort($array)
{
$start = microtime(true);
do
{
$sw = false;
for($i = 0, $size = count($array) - 1; $i < $size; $i++)
{
if( $array[$i] > $array[$i + 1] )
@romanitalian
romanitalian / .bash_profile
Last active March 23, 2018 08:38 — forked from Zveroboev/.bash_profile
Подсветка текущей git ветки при подключении через ssh + показывает текущее время в каждом запросе
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
@romanitalian
romanitalian / haversine.sql
Last active September 28, 2017 14:14 — forked from carlzulauf/haversine.sql
PostgreSQL function for haversine distance calculation, in miles
-- Haversine Formula based geodistance in miles (constant is diameter of Earth in miles)
-- Based on a similar PostgreSQL function found here: https://gist.github.com/831833
-- Updated to use distance formulas found here: http://www.codecodex.com/wiki/Calculate_distance_between_two_points_on_a_globe
CREATE OR REPLACE FUNCTION public.geodistance(alat double precision, alng double precision, blat double precision, blng double precision)
RETURNS double precision AS
$BODY$
SELECT asin(
sqrt(
sin(radians($3-$1)/2)^2 +
sin(radians($4-$2)/2)^2 *

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync