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
# ---- My personal env ----- | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init - zsh)" | |
# starts Mysql | |
[ $(mysql.server status|awk '{ print $1}') != 'SUCCESS!' ] && mysql.server start | |
alias s='subl' | |
alias ll='ls -lah' |
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
$ git update-index --no-assume-unchanged .gitignore Gemfile Gemfile.lock | |
$ git update-index --assume-unchanged .gitignore Gemfile Gemfile.lock | |
$ mysqldump -u username -R oldDbName > oldDbName.sql | |
$ mysqladmin -u username create newDbName | |
$ mysql -u username newDbName < oldDbName.sql | |
# No ruby output during rspec | |
$ RUBYOPT="-W0" bundle exec rspec spec --exclude-pattern "spec/system/**/*.rb" --force-colour |
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
### ElasticSearch was removed as part of 3.0 so this is deprecated | |
### 1. Run ES locally | |
[Official website](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) | |
``` | |
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.9.1 | |
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.9.1 | |
```` |
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/sh | |
# | |
# This script should be run via curl: | |
# sh -c "$(curl -fsSL https://gist.githubusercontent.com/altherlex/15315bebfd9bc65ffb02fad8f899b6a6/raw/azure-auto-changelog.sh)" | |
# or wget: | |
# sh -c "$(wget -qO- https://gist.githubusercontent.com/altherlex/15315bebfd9bc65ffb02fad8f899b6a6/raw/azure-auto-changelog.sh)" | |
# export USER=alther.alves | |
# export PASSWORD=1234 | |
# export ORIGINAL_BRANCH=release/2.5 | |
# export HOTFIX_BRANCH=release/2.4 |
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/sh | |
# | |
# This script should be run via curl: | |
# sh -c "$(curl -fsSL https://gist.githubusercontent.com/altherlex/15315bebfd9bc65ffb02fad8f899b6a6/raw/azure-auto-changelog.sh)" | |
# or wget: | |
# sh -c "$(wget -qO- https://gist.githubusercontent.com/altherlex/15315bebfd9bc65ffb02fad8f899b6a6/raw/azure-auto-changelog.sh)" | |
export FILE_NAME=CHANGELOG-v.$RELEASE_VERSION.md | |
export TEMPLATE_URL=https://gist.githubusercontent.com/altherlex/5f20de7a31b08be82974f8e620310b74/raw/changelog-template.hbs | |
export AZURE_URL=https://dev.azure.com/GetSmartSolutions/The%20Product/_apis/git/pullrequests | |
export API_VERSION=5.1 |
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
// HowToUse: | |
// {{linkWorkItem subject}} | |
module.exports = function (Handlebars) { | |
Handlebars.registerHelper('linkWorkItem', function (context) { | |
var index = context.search(/(\d{3,})\s/g) | |
if (index !== -1 && context.slice(index-1, index) !== '#') { | |
return context.slice(0, index) + '#' + context.slice(index) | |
} | |
return context | |
}) |
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
$ pg_ctl -D /usr/local/var/postgres stop -s -m fast | |
$ pg_ctl -D /usr/local/var/postgres start | |
$ psql | |
> drop database product; | |
> create database product; | |
> \l # list all databases | |
> \c product #use database | |
> \d # list all tables | |
$ pg_restore --username=product --dbname=product -v --no-privileges --no-owner --clean --create ~/Downloads/dev2jan9th.gz | |
$ python manage.py migrate auth |
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
// in Series | |
const result = await rows.reduce((p, album, i) => p.then(async () => { | |
var hotlink_url = ''; | |
try { | |
hotlink_url = await Helper.getHotlink(album.post_url, browser); | |
const r = await pool.query(state, [ album.id, null, moment(new Date()) ]); | |
return r.rows[0]; | |
} catch(e){ | |
console.log('erro ocorrido:', e); | |
} |
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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "aws-sdk" | |
require "pry-nav" | |
def run_ops_client(opsworks, file_path) | |
true_instances = [] | |
stacks = opsworks.describe_stacks.stacks |