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
/** | |
* @description removes the multiples in the array | |
* @param arr | |
* @returns {Number} | |
*/ | |
function notMultiples(arr) { | |
arr = arr.sort((a, b) => a - b); | |
return arr.reduce((notMul, num) => { | |
if (notMul.length) { | |
if ((notMul.some(div => (num % div === 0)))) { |
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
/** | |
* Created by kayslay on 6/3/17. | |
*/ | |
module.exports = { | |
dbName: "crawl", | |
dbHost: "localhost", | |
}; |
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
/** | |
* Created by kayslay on 6/3/17. | |
*/ | |
const mongoose = require('mongoose'); | |
const dbConfig = require('../config/db'); | |
//mongoose configs | |
const Schema = mongoose.Schema; | |
//creating a schema for the extracted data | |
const wikiSchema = new Schema({ | |
title: String, |
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 node | |
/** | |
* Created by kayslay on 5/31/17. | |
*/ | |
const crawler = require('web-crawljs'); | |
const program = require('commander'); | |
//commander configuration | |
function list(val) { | |
"use strict"; |
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
package main | |
import ( | |
"fmt" | |
) | |
var ( | |
list []int = []int{838, 23, 83, 64, 83, 23, 63, 90, 50, 20, 20, 4, 30, 5, 2, 50, 190, 19, 3, 70, 21, 3, 20, 28, 93, 39, 838, 23, 83, 64, 83, 23, 63, 90, 50, 20} | |
) |
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
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 |
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 Charge
on 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.
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
package main | |
import ( | |
"io" | |
"sync" | |
"time" | |
) | |
// a function that does much cpu bound work | |
func fibo(n int) int { |
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
package main | |
import ( | |
"runtime" | |
"testing" | |
) | |
// limit to a single processor | |
var _ = runtime.GOMAXPROCS(1) |
OlderNewer