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
import React, { Component } from "react"; | |
import { Table, Button } from "reactstrap"; | |
import ModalForm from "../Modals/Modal"; | |
class DataTable extends Component { | |
deleteItem = id => { | |
let confirmDelete = window.confirm("Delete item forever?"); | |
if (confirmDelete) { | |
fetch("http://localhost:3000/crud", { | |
method: "delete", |
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
const verifyEmail = (username, email, link) => ` | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<title>Password Reset</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
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
import jwt from "jsonwebtoken" | |
import config from "../config" | |
import User from "../models/user.models" | |
const authorize = (req, res, next) => { | |
const token = req.headers["authorization"] | |
if (!token) { | |
return res.status(403).json({ | |
auth: false, | |
message: "Please login a user" |
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
const axios = require("axios"); | |
class FetchWeather { | |
constructor(apiKey) { | |
this.apiKey = apiKey; | |
this.locations = ["nairobi"]; | |
} | |
getWeatherByLocations() { | |
this.locations.map(location => { |
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
Verifying my Blockstack ID is secured with the address 19r4mRhbadatZSHZU22GbMzSp2qCiLjF8k https://explorer.blockstack.org/address/19r4mRhbadatZSHZU22GbMzSp2qCiLjF8k |
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
const axios = require('axios') | |
const express = require('express') | |
const { DateTime } = require('luxon') | |
require('dotenv').config() | |
const darkSkyApiKey = process.env.DARK_SKY_API_KEY | |
const gcpKey = process.env.GCP_KEY | |
const darkSkyBaseUrl = `https://api.darksky.net/forecast` | |
const address = process.argv.slice(2) |
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
#!/bin/bash | |
if [ "$1" == "" ] | |
then | |
echo "You forgot an IP address" | |
echo "Syntax: ./ipsweep.sh 192.168.111" | |
else | |
for ip in `seq 1 254`; do | |
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" & | |
done |
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
#!/bin/python3 | |
import sys # Allows us to enter command line arguments | |
import socket | |
from datetime import datetime | |
# Define our target | |
if len(sys.argv) == 2: | |
target = socket.gethostbyname(sys.argv[1]) # Transalate a host name to ipv4 | |
else: |
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 scrapper | |
import ( | |
"fmt" | |
// "io/ioutil" | |
"net/http" | |
"time" | |
"github.com/PuerkitoBio/goquery" | |
) |
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_at": "Sat Dec 19 02:22:35 +0000 2020", | |
"id_str": "1340120314898857984", | |
"full_text": "carp", | |
"display_text_range": [ | |
0, | |
4 | |
], | |
"entities": {}, | |
"source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>", |
OlderNewer