Skip to content

Instantly share code, notes, and snippets.

@leggomuhgreggo
leggomuhgreggo / check-session-v2.js
Created April 12, 2018 20:48
Second version of check section
...
const checkSessionThunk = async (dispatch, getState, actionObj) => {
const { user } = getState();
const sessionIsValid = () =>
userHasExistingSession(user) && userSessionHasExpired(user);
sessionIsValid()
? handleValidSession(dispatch, getState, actionObj)
: handleInvalidSession(dispatch, getState, actionObj);
@leggomuhgreggo
leggomuhgreggo / client-session-check.js
Last active April 11, 2018 19:08
much conditional. very overlap circles venn diagram.
...
const checkSessionThunk = async (dispatch, getState, actionObj) => {
const session = getConditions(dispatch, getState, actionObj);
if (session.validSessionAndRedirectDeclared) {
return dispatch(goToRedirectURL());
}
if (session.validSessionAndRouteLogin) {
@leggomuhgreggo
leggomuhgreggo / grep.text
Last active February 29, 2020 18:34
Command to grep spoofed package names from hacktask npm user
find . -name "package.json" -exec grep -nwE 'babelcli|crossenv|cross-env.js|d3.js|fabric-js|ffmepg|gruntcli|http-proxy.js|jquery.js|mariadb|mongose|mssql.js|nodecaffe|nodefabric|node-fabric|nodeffmpeg|nodemailer-js|nodemailer.js|nodemssql|node-opencv|node-opensl|node-openssl|noderequest|nodesass|nodesqlite|node-sqlite|node-tkinter|opencv.js|openssl.js|proxy.js|shadowsock|smb|sqlite.js|sqliter|sqlserver|tkinter' {} +