Skip to content

Instantly share code, notes, and snippets.

@shlykov
shlykov / warehouses.json
Last active August 21, 2018 06:57
warehouses.json
{
"warehouses": [
{
"id": 1, "name": "Store 1", "address": "Perm, Lenina 1", "capacity": 10000,
"items": [
{"id": 1, "name": "Картоха", "type": "food", "size": 1, "quantity": 1000},
{"id": 2, "name": "Морква", "type": "food", "size": 1, "quantity": 3000},
{"id": 3, "name": "Редиска", "type": "food", "size": 1, "quantity": 5999}
]
},
@shlykov
shlykov / Vagrantfile
Last active August 15, 2018 05:46
Xsolla summer school 2018 - Backend
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.hostname = "xsolla-summer-school-2018"
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder ".", "/home/xsolla"
config.vm.network "private_network", ip: "192.168.100.123"
config.vm.provider "virtualbox" do |vb|
@shlykov
shlykov / snippet1.sh
Last active July 19, 2016 11:22
HTTP AND MVC SNIPPETS
nslookup php.net
telnet 72.52.91.14 80
GET / HTTP/1.1
Host: php.net
Connection: close
@shlykov
shlykov / gitlab-ci-builds-check.rb
Created February 8, 2016 09:41
Recipe for checking gitlabCI builds from capistrano 2
require 'net/http'
require 'capistrano'
require 'uri'
require 'json'
namespace :ci do
desc 'Check ci on success build'
task :check_build, :on_error => :abort do
commit_state = false
url = "https://gitlab.com/api/v3/projects/#{gitlab_project_id}/repository/commits/#{real_revision}/statuses?private_token=#{auth_token}"

To delete local branches which have alread been merged into master:

git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d

Remove remote merged branches git branch -r --merged origin/master | sed '/master/d;/origin/!d;s:origin/::' |xargs -n 1 git push origin --delete

# Ignore everything in this directory
*
# Except this file
!.gitignore