Skip to content

Instantly share code, notes, and snippets.

View queirozsc's full-sized avatar

Sergio Carvaho Queiroz queirozsc

View GitHub Profile
#!/bin/bash
command_exists () {
type "$1" &> /dev/null ;
}
export GITHUB_REPO="user/repo"
export GITHUB_USERNAME=$(cat ~/.githubrc 2> /dev/null | grep user.login | cut -d ":" -f2 | xargs)
export GITHUB_PASSWORD=$(cat ~/.githubrc 2> /dev/null | grep user.password | cut -d ":" -f2 | xargs)
if [ -z "$GITHUB_USERNAME" ]
#!/bin/bash
export GITHUB_REPO="user/repo"
export GITHUB_USERNAME=$(cat ~/.githubrc 2> /dev/null | grep user.login | cut -d ":" -f2 | xargs)
export GITHUB_PASSWORD=$(cat ~/.githubrc 2> /dev/null | grep user.password | cut -d ":" -f2 | xargs)
if [ -z "$GITHUB_USERNAME" ]
then
read -p "Type your Github username: " GITHUB_USERNAME
echo "user.login: $GITHUB_USERNAME" >> ~/.githubrc
fi
@diogonicoleti
diogonicoleti / post-mortem-template.md
Created November 29, 2017 22:38
Template de Postmortem

Data

YYYY-MM-dd

Autores

  • @fulano
  • @ciclano

CheckPoints

aws iam attach-user-policy --user-name [username] --policy-arn arn:aws:iam::aws:policy/AWSCodeCommitFullAccess
aws iam attach-user-policy --user-name [username] --policy-arn arn:aws:iam::aws:policy/IAMReadOnlyAccess
aws iam attach-user-policy --user-name [username] --policy-arn arn:aws:iam::aws:policy/IAMSelfManageServiceSpecificCredentials
@codemarc
codemarc / Qlik Sense Mashups
Last active January 23, 2018 10:42
Javascript snippets I use in my Mashups
/*
* Marc's Basic Mashup template
* @owner Marc J. Greenberg
*/
String.prototype.format = function () { var args = arguments; return this.replace(/\{\{|\}\}|\{(\d+)\}/g, function (m, n) { if (m == "{{") { return "{"; } if (m == "}}") { return "}"; } return args[n]; }); };
String.prototype.startsWith = function (s) { return (this.match("^" + s) == s); };
String.prototype.endsWith = function (s) { return (this.match(s + "$") == s); };
var getQueryVariable = function (variable) {
var query = window.location.search.substring(1), vars = query.split('&');
@codemarc
codemarc / Qlik Sense
Last active June 22, 2021 05:15
A collection Qlik Sense snippets
// Set Analysis: last 30 days
Count({$<DateCreated={">=$(=Date(max(DateCreated)-30, 'DD/MM/YYYY'))"}>}DateCreated)
// Set Analysis: all Entries opened today and in the general support category
Count({1<[DateCreated.autoCalendar.Date]={'$(=Today())'},[Category]={'General Support'}>}EntryId)
// Set Analysis: all Entries opened yesterday and in the general support category
Count({1<[DateCreated.autoCalendar.Date]={'$(=Date(Today()-1))'},[Category]={'General Support'}>}EntryId)
@mountaindude
mountaindude / date_variables.qvs
Last active January 23, 2018 10:43
QlikView and Qlik Sense date variables
let vStartOf2ndPreviousQuarter = Date(Floor(QuarterStart(Today(), -2)), 'YYYY-MM-DD');
let vStartOf2ndPreviousQuarterNum = Num(Date(Floor(QuarterStart(Today(), -2)), 'YYYY-MM-DD'));
let vStartOfPreviousQuarter = Date(Floor(QuarterStart(Today(), -1)), 'YYYY-MM-DD');
let vStartOfPreviousQuarterNum = Num(Date(Floor(QuarterStart(Today(), -1)), 'YYYY-MM-DD'));
let vStartOfCurrentQuarter = Date(Floor(QuarterStart(Today())), 'YYYY-MM-DD');
let vStartOfCurrentQuarterNum = Num(Date(Floor(QuarterStart(Today())), 'YYYY-MM-DD'));
let vStartOfPreviousMonth = Date(Floor(MonthStart(Today(), -1)), 'YYYY-MM-DD');
@darribas
darribas / guardian_gaza.ipynb
Created November 20, 2012 22:58
A IPython Notebook to analyze the Gaza-Israel 2012 crisis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.