Skip to content

Instantly share code, notes, and snippets.

View kayslay's full-sized avatar
🎯
Focusing

Badewa Kayode kayslay

🎯
Focusing
View GitHub Profile
const crawler = require("web-crawljs");
/**//
* @description removes duplicate hotels for the array
* @param arr
* @returns {Array.<T>|*}
*/
function makeUnique(arr) {
"use strict";
const key = {};
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const hotelSchema = new Schema({
hotel_name: {type: String},
location: {type: String},
city: {type: String},
state: {type: String},
present_price: {type: String},
features: {type: [String]},
hotelsNg_link: {type: String},
package main
import (
"context"
"fmt"
"log"
"sync"
"testing"
"time"
)
package main
import (
"encoding/json"
"errors"
"log"
"net/http"
)
// mockInfoSaver mock implementation of infoSaver
package main
import (
"log"
"sync"
"time"
)
var (
duration = time.Second * 5
package main
import (
"runtime"
"testing"
)
// limit to a single processor
var _ = runtime.GOMAXPROCS(1)
package main
import (
"io"
"sync"
"time"
)
// a function that does much cpu bound work
func fibo(n int) int {
@kayslay
kayslay / busha-pay-socket.md
Last active July 22, 2019 16:18
Busha Pays socket connection

BushaPay socket connection

Once a charge has been created, it status can be monitored by connecting the websocket client to https://api.pay.busha.co/charges/{chargeID}/status.

Replace chargeID in the route with id of created/existing charge.

The socket sends a Chargeon every update. whenever an event (payment,expire .e.t.c) occurs on the full charge object with the updates. check charge resource for more details.

@kayslay
kayslay / Xvfb-restart-script.sh
Created March 13, 2018 04:45 — forked from Nimrod007/Xvfb-restart-script.sh
Xvfb restart script
echo "restart Xvfb"
kill -9 `ps aux | grep Xvfb | grep -v grep | awk '{print $2}'`
sleep 3
nohup Xvfb :10 -ac > /tmp/Xvfb.log 2>&1 &
echo "Xvfb started"
exit