Skip to content

Instantly share code, notes, and snippets.

View raphaklaus's full-sized avatar
🎲

Raphael D. Pinheiro raphaklaus

🎲
View GitHub Profile

Keybase proof

I hereby claim:

  • I am raphaklaus on github.
  • I am raphaklaus (https://keybase.io/raphaklaus) on keybase.
  • I have a public key ASA6tJFV5pxLcHq4v1k1w9RZwTx_8rE2fUnz4nAK2kjJdwo

To claim this, I am signing this object:

@raphaklaus
raphaklaus / main.js
Created April 6, 2018 17:40
Woo Coupon Box JavaScript Close Bugfix
// wp-content/plugins/woo-coupon-box/js/wcb.js
// Replace in these functions: init_button() and widget_button() the popup_show() function which doesn't exist as follow:
function init_button() {
// ...
jQuery('.wcb-coupon-box').html(content);
jQuery('.wcb-widget-newsletter').html('<p class="vi-ps-sucesss"><i class="fa fa-check-square"></i>Thank you for subscribe</p>');
popup_hide();
} else {
TelegramBot.prototype.onTextReply = function (regexp, userId, callback) {
this.textRegexpCallbacks.push({regexp: regexp, userId: userId,
type: 'reply', callback: callback});
};
TelegramBot.prototype._processUpdate = function (update) {
debug('Process Update %j', update);
var message = update.message;
var inline_query = update.inline_query;
var chosen_inline_result = update.chosen_inline_result;
// localhost/numeroPar&numero=2
function getNumeroPar(res, req, next) {
numerpPar(req.params.numero).then(function(){
res.send('É par!');
})
.catch(function(){
res.send('É ímpar!');
});
}
function numeroPar(numero) {
return new Promise(function(resolve, reject) {
setTimeout(function() {
if (numero % 2 === 0)
resolve();
else
reject(new Error('Não é um número par');
}, 2000);
});
}
getAccess(function() {
getUsers(function() {
createProduct({name: 'Mesa'}, function() {
deleteTemporaryUser(function() {
console.log('Finalmente terminou!');
});
});
});
});
class Inviter {
constructor() {
// this.groupId = groupId;
// this.userId = userId;
this.GruposPool = bookshelf.Model.extend({
tableName: 'MensageriaExternaGrupoPool'
});
bookshelf.transaction((t) => {
new this.GruposPool().where({disponivel: true}).orderBy('id', 'ASC').fetchAll().then(grupos => {
class Inviter {
constructor() {
// this.groupId = groupId;
// this.userId = userId;
this.GruposPool = bookshelf.Model.extend({
tableName: 'MensageriaExternaGrupoPool'
});
bookshelf.transaction((t) => {
new this.GruposPool().where({disponivel: true}).orderBy('id', 'ASC')
request('http://www.google.com', function(error, response, body) {
if (error)
throw error;
doThings(response, body);
});
function calculaIPI(produto){
return produto.industrializado ? produto.total * 0.10
: 0;
}
function calculaValorFinal(produto, callback){
return produto.total + callback(produto);
}
var cadeiraExecutiva = {