Skip to content

Instantly share code, notes, and snippets.

View jincod's full-sized avatar

Vadim Abdrashitov jincod

View GitHub Profile
Function GetChangelog {
param($from, $to, $baseurl, $project)
$cred = (Get-Credential)
$username = $cred.GetNetworkCredential().username
$password = $cred.GetNetworkCredential().password
$auth = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$($username):$($password)"))
@jincod
jincod / install.ps1
Last active May 17, 2021 10:44
VS Code settings
# Windows %USERPROFILE%\.vscode\extensions
# Mac ~/.vscode/extensions
# Windows %APPDATA%\Code\User\settings.json
# Mac $HOME/Library/Application Support/Code/User/settings.json
# code --list-extensions
$gist = "https://gist.github.com/jincod/93d2bddb32cab3b72b23657cc8e69255/raw"
Invoke-WebRequest https://api.github.com/gists/b40b003fd360823c8890 | ConvertFrom-Json | ForEach-Object { $_.file
s.psobject.properties.Value.raw_url } | ForEach-Object {Invoke-WebRequest $_ -OutFile $(Split-Path -Path $_ -Leaf) }
. { iwr -useb https://gist.github.com/jincod/4f183172e46a64179a12/raw/d28d76d8186d8e10b5dee0ee60ca1dcdb341b663/default.ps1 } | iex;
rotate-backups --monthly=4 --include="backup-*.tar.gz" --dry-run -v .
@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
@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 / 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 / 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 / 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 / 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) {