This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
# The ServerName directive sets the request scheme, hostname and port that | |
# the server uses to identify itself. This is used when creating | |
# redirection URLs. In the context of virtual hosts, the ServerName | |
# specifies what hostname must appear in the request's Host: header to | |
# match this virtual host. For the default virtual host (this file) this | |
# value is not decisive as it is used as a last resort host regardless. | |
# However, you must set it for any further virtual host explicitly. | |
#ServerName www.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo rm -rf /var/www/example.com/public_html | |
sudo rm -rf /var/www/test.com/public_html | |
sudo mkdir -p /var/www/example.com/public_html | |
sudo mkdir -p /var/www/test.com/public_html | |
sudo chown -R ubuntu:ubuntu /var/www/example.com/public_html | |
sudo chown -R ubuntu:ubuntu /var/www/test.com/public_html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import sys | |
def getUniqueKey(fp): | |
""" | |
Calculate unique as integer value of last date-time changed of file and his size | |
:param fp: | |
:return: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f(x) { return 28 + (x + Math.floor(x/8)) % 2 + 2 % x + 2 * Math.floor(1/x); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP 5.6+ | |
/** | |
* Фильтруем массив по ключам | |
*/ | |
function arrayFilterByKeys($_rows, $_filter_keys) | |
{ | |
$fk = array_fill_keys($_filter_keys, true); | |
$filter = function($key) use ($fk) {return isset($fk[$key]) && $fk[$key];}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$rows = array('a' => 1, 'b' => 2); | |
$f = array(2 => true); | |
function array_filter_by_values($_rows, $_filter_keys) { | |
$filter = function($key) use ($_filter_keys) {return isset($_filter_keys[$key]) && $_filter_keys[$key];}; | |
$out = array_filter($_rows, $filter); | |
return $out; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hello | |
Nice GistLog: https://gistlog.co/romanitalian/718c32270ba813f6d67c4f71c0215c3b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/mailru/go-clickhouse" | |
"time" | |
"database/sql" | |
"log" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 * |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3.1415926535897932384626433832795028841971693993751058209749445923078164062862 | |
089986280348253421170679821480865132823066470938446095505822317253594081284811 | |
174502841027019385211055596446229489549303819644288109756659334461284756482337 | |
867831652712019091456485669234603486104543266482133936072602491412737245870066 | |
063155881748815209209628292540917153643678925903600113305305488204665213841469 | |
519415116094330572703657595919530921861173819326117931051185480744623799627495 | |
673518857527248912279381830119491298336733624406566430860213949463952247371907 | |
021798609437027705392171762931767523846748184676694051320005681271452635608277 | |
857713427577896091736371787214684409012249534301465495853710507922796892589235 | |
420199561121290219608640344181598136297747713099605187072113499999983729780499 |