Skip to content

Instantly share code, notes, and snippets.

View sethdorris's full-sized avatar

Seth Dorris sethdorris

  • Fort Collins, CO
View GitHub Profile
//form = require("form-data2");
for (var i = 0; i < updateObject.Documents.length; i++) {
try {
var document = updateObject.Documents[i];
var directory = Utilities.ConvertToDirectory(document.sUASID);
document.directory = directory;
var documentPath = path.join(__dirname, "../../", `DownloadFiles/${directory}/${document.filename}`);
var contentType = Utilities.GetContentType(document.filename);
var promiseToAdd = new Promise((resolve, reject) => {
router.post("/login", [
check("username").isAlphanumeric(),
check("password").isLength({ min: 8 })
], async (req, res, next) => {
console.log("Testing");
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.sendStatus(401);
}
const RequestTable = () => {
const [localReqs, setLocalReqs] = useState({});
const state = useAsync(async () => {
let reqs = await GetAccountRequests();
setLocalReqs({ ...localReqs, values: reqs });
});
const ApproveAccount = async () => {
console.log("Clicked");
router.post("/login", [
check("username").isAlphanumeric(),
check("password").isLength({ min: 8 })
], async (req, res, next) => {
console.log("Testing");
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.sendStatus(401);
}
public class Model1 {
public List<Round> Rounds {get;set;}
public Model1(int rounds)
{
for (var i = 0; i < rounds; i++)
{
Model2.Add(new Model2($"{(i + 1).ToString()}"));
}
}
const LoginFormComponent = ({ history }) => {
const localState = {
username: '',
password: '',
serverError: false
}
const handleInputChange = (event) => {
localState[event.target.name] = event.target.value
public class TestClass {
public int FuseID {get;set;}
public int SID {get;set;}
public TestClass2 OtherClass {get;set;}
}
public class TestClass2 {
public int? GroupId {get;set;}
}
WHD | Name | GroupNumber
------------------------------
1 | Name1 | null
2 | Name2 | 2
3 | Name3 | 2
desired output
WHD | Name | GroupNumber | DisplayName
class MyClass {
public int? GroupId {get;set;}
public string Name {get;set;}
}
//Desired Output
{ GroupId = 1, Name = "Instance 1 / Instance 2 / Instance 3" }
{ GroupId = null, Name = "Instance 4" }
{ GroupId = null, Name = "Instance 5" }
const MyComponent = () => {
const IsAdmin = useSelector(state => state.UserData.Roles.indexOf("Admin") > -1);
const AdminButton = IsAdmin ? <AdminButton>Admin</AdminButton> : null;
return (
{AdminButton}
}
}