This file contains 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
#!/bin/bash | |
if [[ -z $1 ]] | |
then | |
echo "Usage: $0 <env>" | |
echo "" | |
echo "Allowed env values: p1, d1, sl-loki, sl-cdfw" | |
echo "" | |
elif [[ "$1" = "p1" ]] | |
then | |
sl aws session generate --profile p1 --role-name engineer --account-id 067346688434 --region eu-west-2 |
This file contains 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
import csv | |
import MySQLdb | |
from pprint import pprint | |
mydb = MySQLdb.connect(host='127.0.0.1', | |
user='root', | |
passwd='pa55word', | |
db='metro') | |
This file contains 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
from flask import Blueprint, session, url_for, jsonify, request, g | |
from app import app | |
from app import oauth, oauth_client | |
from app.database import connection | |
from app.blueprints.auth import require_login | |
sprava = Blueprint('sprava', __name__) | |
sprava_app = oauth_client.remote_app( | |
'sprava', |
This file contains 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
lists:foldl(fun(El, Acc) -> | |
case El of | |
"10001" -> Acc + 1; | |
_ -> Acc | |
end, | |
0, List); |
This file contains 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
%% | |
%% Convert seconds, minutes etc. to milliseconds. | |
%% | |
-spec seconds(Seconds) -> MilliSeconds when | |
Seconds :: non_neg_integer(), | |
MilliSeconds :: non_neg_integer(). | |
seconds(Seconds) -> | |
1000*Seconds. | |
-spec minutes(Minutes) -> MilliSeconds when | |
Minutes :: non_neg_integer(), |
This file contains 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
#!perl | |
use strict; | |
use warnings; | |
open my $fh, "<", "publicsuffix.dat"; | |
my $tree = {}; | |
while (<$fh>) { |
This file contains 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
!perl | |
use strict; | |
use warnings; | |
my $ptr = 0; | |
my @tape = (0) x 5000; | |
my $op_idx = 0; | |
my @cmds; |
This file contains 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
{ | |
"keys": [ | |
"perl_to_php_testkey", | |
"php_to_perl_testkey", | |
"php_to_perl_compressed_testkey" | |
], | |
"values": [ | |
"this is a foo bar string", // string - just random string | |
42, // integer - answer to a question about universe | |
5.6, // float - nice apperture value :) |
This file contains 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 Father; | |
$VERSION = "0.01"; | |
sub new { | |
my $self = {}; | |
bless $self; | |
return $self; | |
}; |
This file contains 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 Foo; | |
## моя статистика | |
our $stats = {}; | |
sub new { | |
return bless {}, shift; | |
} | |
$SIG{INT} = sub { |
NewerOlder