Skip to content

Instantly share code, notes, and snippets.

View dallas-x's full-sized avatar

Dallas Baker dallas-x

View GitHub Profile
@dallas-x
dallas-x / App.js
Created March 21, 2021 23:45
antd table
import React from "react";
import ReactDOM from "react-dom";
import EventsSection from "./EventsSection";
function App() {
return (
<div className="App">
<EventsSection />
</div>
);
@dallas-x
dallas-x / htmlParser.js
Created August 27, 2019 21:25
extract table data. Only class name is proxy-row for the row. I need to extract data about the proxies from the table.
import cheerio from 'cheerio';
function parseList(response) {
return new Promise((resolve, reject) => {
const $ = cheerio.load(response.data);
try {
$('.proxy-row').each((i, el) => {
$(el).find('td').each((i, el) => {
console.log($(el).text());
});
@dallas-x
dallas-x / Decode_n_times
Last active June 16, 2018 12:06
Decode txt file n number of times
#!/bin/bash
# n can not be greater than 25!
# if you need more than 25 then i would suggest a loop that manipulates a global variable $temp!
decodeFile($n, $file) {
if (n == 0) echo $file
else {
base64 -d $file > $file
echo $(decodeFile($n-1, $file)
}
@dallas-x
dallas-x / testing.ps1
Created March 31, 2018 04:15
working with powershell
$collection = New-Object System.Collections.ArrayList
$GroupedIP = New-Object System.Collections.ArrayList
$counter
$start = 0
$finish = 0
Do {
if ($file[$counter].'Source IP' -eq $file[$counter+1].'Source IP'){
$collection.Add($file[$counter]) | Out-Null
$finish++
}
@dallas-x
dallas-x / local.strategy.js
Created May 23, 2017 22:46
does this look sloppy?
var passport = require('passport'),
LocalStrategy = require('passport-local').Strategy,
sql = require('mssql');
module.exports = function () {
passport.use(new LocalStrategy({
usernameField:'userName',
passwordField:'password'
},
function(username, password, done) {
@dallas-x
dallas-x / authBooks
Created May 12, 2017 16:10
for chris
var express = require('express');
var authRouter = express.Router();
var ejs = require('ejs');
const fs = require('fs');
const execFile = require('child_process').execFile;
function qa_tools(){
console.log('running...')
const child = execFile('qa-pat-links',
['-P', 'http://www.apple.com/iphone/'],