Skip to content

Instantly share code, notes, and snippets.

View robertopc's full-sized avatar

Roberto Pereira da Costa robertopc

View GitHub Profile
import 'cordova-plugin-purchase';
document.addEventListener('deviceready', onDeviceReady);
let log: CdvPurchase.Logger;
let statusMessage: null | string = null;
function setStatusMessage(value: null | string) {
if (statusMessage !== value) {
statusMessage = value;
renderStatusUI();
@robertopc
robertopc / index.ts
Created October 27, 2023 20:44 — forked from j3k0/index.ts
cordova-purchase-plugin v13 - micro example
document.addEventListener('deviceready', onDeviceReady);
function onDeviceReady() {
const store = CdvPurchase.store;
const { ProductType, Platform, LogLevel, Product, VerifiedReceipt } = CdvPurchase; // shortcuts
// We should first register all our products or we cannot use them in the app.
store.register([{
id: 'demo_monthly_basic',
@robertopc
robertopc / nginxproxy.md
Created March 18, 2023 20:21 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@robertopc
robertopc / git-pull-all
Created July 19, 2022 18:30 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@robertopc
robertopc / str_ireplace_array.php
Created May 7, 2020 20:10 — forked from adhocore/str_ireplace_array.php
A str_replace_array for PHP
<?php
/**
* A str_ireplace_array for PHP
*
* Case insensitive version of str_replace_array
* See https://wiki.php.net/rfc/cyclic-replace
*
* @author Jitendra Adhikari | adhocore <[email protected]>
*
@robertopc
robertopc / gist:fc1abb2ddbe5fcf4af15365386a38599
Created May 31, 2019 15:14 — forked from avelino/gist:3188137
shell script, como colorir o retorno do seu código
echo -e " \033[0;30m Preto \033[0m --> 0;30 "
echo -e " \033[0;31m Vermelho \033[0m --> 0;31 "
echo -e " \033[0;32m Verde \033[0m --> 0;32 "
echo -e " \033[0;33m Marrom \033[0m --> 0;33 "
echo -e " \033[0;34m Azul \033[0m --> 0;34 "
echo -e " \033[0;35m Purple \033[0m --> 0;35 "
echo -e " \033[0;36m Cyan \033[0m --> 0;36 "
echo -e " \033[0;37m Cinza Claro \033[0m --> 0;37 "
echo -e " \033[1;30m Preto Acinzentado \033[0m --> 1;30 "
echo -e " \033[1;31m Vermelho Claro \033[0m --> 1;31 "
@robertopc
robertopc / gist:d083223dd324c4fd44a34f3a9ab09bb0
Created December 18, 2017 18:22 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@robertopc
robertopc / jekyll-new-post-advanced
Last active November 29, 2017 22:16 — forked from aamnah/jekyll-new-post-advanced
Bash script to create new Jekyll posts
#!/bin/bash
# About: Bash script to create new Jekyll posts
# Author: @AamnahAkram
# URL: https://gist.github.com/aamnah/f89fca7906f66f6f6a12
# Description: This is a more advanced version of the script which can
# - take options
# - has color coded status messages
# - improved code
# - lowercase permalinks
# - usage message
@robertopc
robertopc / .gitconfig
Created November 8, 2017 22:21 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@robertopc
robertopc / Digital-Ocean-Ubuntu-1210-64bit-LAMP-Server
Created September 28, 2016 14:27
Digital Ocean Ubuntu 12.10 64bit LAMP Setup
#!/bin/bash
# log into your server
ssh root@[server ipaddress]
# change root password
passwd
# update all packages and operating system
apt-get update && apt-get --yes upgrade