Skip to content

Instantly share code, notes, and snippets.

View imorte's full-sized avatar
:shipit:

Kirill imorte

:shipit:
  • Hamburg, Deutschland
  • 11:44 (UTC +02:00)
View GitHub Profile
@imorte
imorte / err.log
Created September 25, 2018 16:40
Getting org.scala-sbt sbt 1.2.1 (this may take some time)...
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
@imorte
imorte / postgres_queries_and_commands.sql
Created September 11, 2018 05:41 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
// import slick from 'slick';
// var script = "/images/fo-page/all/los-na-mostu-3d.jpg"
function media() {
$(window).resize(function(i, v) {
var width = $('body').width()/$('.count_page').attr('data-count');
$('.containers_count_page').css('width', width);
@imorte
imorte / docker-cleanup-resources.md
Created December 30, 2017 13:07 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@imorte
imorte / mysql-docker.sh
Created August 22, 2017 05:34 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
<?php
namespace App;
/**
* Class Translation
* @package App\Translate
*/
class Translation {
// Slashes is required
@imorte
imorte / main.js
Created July 30, 2017 13:05
recursive summ js
/**
* Created by kirill on 30/07/2017.
*/
array = [1, 2, 3, 4];
function rec_sum(array) {
if(array.length > 1) {
return array[0] + rec_sum(array.slice(1))
} else {
@imorte
imorte / index.php
Created July 29, 2017 10:11
Selection sort php
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . 'vendor/autoload.php';
$array = [5, 1, 0, 8, 1234, 345];
function findSmallest(array $array) {
$value = $array[0];
$index = 0;
/*
LiquidCrystal Library - Custom Characters
Demonstrates how to add custom characters on an LCD display.
The LiquidCrystal library works with all LCD displays that are
compatible with the Hitachi HD44780 driver. There are many of
them out there, and you can usually tell them by the 16-pin interface.
This sketch prints "I <heart> Arduino!" and a little dancing man
to the LCD.
@imorte
imorte / rspec_rails_cheetsheet.rb
Created January 29, 2017 15:54 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)