Skip to content

Instantly share code, notes, and snippets.

View DavidNgugi's full-sized avatar
🎯
Focusing

David Ngugi DavidNgugi

🎯
Focusing
View GitHub Profile
const fs = require('fs');
const wordnet = require('wordnet');
const natural = require('natural');
const tokenizePhrase = (phrase) => {
// Tokenize the phrase into individual words
const tokenizer = new natural.WordTokenizer();
return tokenizer.tokenize(phrase.toLowerCase());
};
@DavidNgugi
DavidNgugi / cryptocoins.py
Created February 10, 2021 13:54
Fetch coin data from coincodex and saves to json file
import requests
import json
URL='https://coincodex.com/apps/coincodex/cache/all_coins_packed.json'
try:
res = requests.get(URL)
content = json.loads(res.content)
columns = content['columns'][::10000]
coin_data = content['data']
@DavidNgugi
DavidNgugi / coincodex-scraper.py
Last active February 10, 2021 11:22
Scrape CoinCodex for crypto icon url, ticker symbols and names
import requests
from bs4 import BeautifulSoup
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
opts = Options()
@DavidNgugi
DavidNgugi / africas_talking.php
Created February 12, 2019 08:20
Africas Talking Config file
<?php
return [
/*
|--------------------------------------------------------------------------
| Africas Talking Username
|--------------------------------------------------------------------------
|
*/
@DavidNgugi
DavidNgugi / TestCommand.php
Created February 12, 2019 07:56
Artisan Test Command
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class TestCommand extends Command
{
/**
* The name and signature of the console command.
@DavidNgugi
DavidNgugi / AfricasTalkingGateway.php
Created February 12, 2019 07:50
AfricasTalking Gateway API
<?php
namespace App\AfricasTalking;
/*
# COPYRIGHT (C) 2014 AFRICASTALKING LTD <www.africastalking.com>
AFRICAStALKING SMS GATEWAY CLASS IS A FREE SOFTWARE IE. CAN BE MODIFIED AND/OR REDISTRIBUTED
UNDER THE TERMS OF GNU GENERAL PUBLIC LICENCES AS PUBLISHED BY THE
FREE SOFTWARE FOUNDATION VERSION 3 OR ANY LATER VERSION
@DavidNgugi
DavidNgugi / ResponseTrait.php
Created February 12, 2019 07:48
Response Trait for both success and error responses
<?php
namespace App\Helpers\Traits;
use Illuminate\Http\Request;
use Log;
/**
* ResponseTrait Trait
@DavidNgugi
DavidNgugi / UuidTrait.php
Created February 12, 2019 07:46
UUID trait
<?php
namespace App\Helpers\Traits;
use Illuminate\Support\Str;
trait UuidTrait
{
public function scopeByUuid($query, $uuid)
{
@DavidNgugi
DavidNgugi / DateFormater.php
Created February 12, 2019 07:43
DateFormater Trait
<?php
namespace App\Helpers\Traits;
use Carbon\Carbon;
/**
* DateFormater Trait
*/
trait DateFormater
@DavidNgugi
DavidNgugi / README.md
Created January 28, 2019 13:34 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet