Skip to content

Instantly share code, notes, and snippets.

View jincod's full-sized avatar

Vadim Abdrashitov jincod

View GitHub Profile
@jincod
jincod / default.ps1
Last active January 29, 2018 17:47
Run NUnit3 tests from powershell
$ProjectDir = "."
$PackagesDir = "$ProjectDir\packages"
$OutDir = "$ProjectDir\bin\Debug"
# Install NUnit Test Runner
$nuget = "$ProjectDir\.nuget\nuget.exe"
& $nuget install NUnit.Runners -ExcludeVersion -o $PackagesDir
# Set nunit path test runner
$nunit = "$ProjectDir\packages\NUnit.ConsoleRunner\tools\nunit3-console.exe"
@jincod
jincod / docker-compose.yml
Created March 28, 2016 08:17
docker-compose config
---
version: '2'
volumes:
pgdata: {}
services:
db:
image: postgres:latest
ports:
@jincod
jincod / transform.js
Created July 1, 2016 10:43
Remove 'es6-promise' imports from legacy code. Using https://github.com/facebook/jscodeshift
export default function transformer(file, api) {
const j = api.jscodeshift;
return j(file.source)
.find(j.ImportDeclaration, {
source: {
value: 'es6-promise'
}
})
.filter(({node}) => node.specifiers.filter(value => value.local.name === 'Promise').length > 0)
@jincod
jincod / index.js
Created August 18, 2016 10:54
Update google sheet
const google = require('googleapis');
const sheets = google.sheets('v4')
const key = require('./google-key.json');
const scope = [
'https://www.googleapis.com/auth/spreadsheets'
];
const spreadsheetId = 'spreadsheetId';
const auth = new google.auth.JWT(key.client_email, null, key.private_key, scope, null);
auth.authorize(function(err, tokens) {
@jincod
jincod / default.ps1
Last active April 26, 2018 18:23
Powershell script: Delete all log groups from AWS CloudWatch
aws logs describe-log-groups --query logGroups --output json | ConvertFrom-Json |
ForEach-Object {$_.logGroupName} | ForEach-Object { aws logs delete-log-group --log-group-name $_ }
@jincod
jincod / prepare-commit-msg
Last active July 27, 2017 08:40
git hook for added branch name to commit message
#!/bin/sh
PROJECT_NAME="PROJECT_NAME"
COMMIT_MSG=$1
IS_EXISTS=$(cat $COMMIT_MSG |grep -i "$PROJECT_NAME"|wc -l)
FULL_BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
BRANCH_NAME=${FULL_BRANCH_NAME##*/}
addBranchName() {
echo "$BRANCH_NAME" "$(cat $COMMIT_MSG)" > $COMMIT_MSG
}
@jincod
jincod / main.yml
Created November 7, 2016 06:51
Install compose
---
- name: Creates directory
file: path=/var/projects/teamcity state=directory
- name: Copy configs
copy: src="{{item}}" dest="/var/projects/teamcity/{{item}}"
with_items:
- nginx.conf
- docker-compose.yml
@jincod
jincod / run.sh
Created February 1, 2017 06:56
Update images using docker-compose
docker-compose stop
docker-compose pull
docker-compose up -d
@jincod
jincod / .editorconfig
Last active March 20, 2017 15:15
Dotfiles
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
[*.js]
indent_style = tab
indent_size = 2
rotate-backups --monthly=4 --include="backup-*.tar.gz" --dry-run -v .