Skip to content

Instantly share code, notes, and snippets.

View wsfuller's full-sized avatar
🏠
Working from home

Steve Fuller wsfuller

🏠
Working from home
View GitHub Profile
{
"search.location": "sidebar",
"workbench.iconTheme": "vscode-icons",
"window.zoomLevel": 0,
"todohighlight.isEnable": true,
"files.insertFinalNewline": true,
"editor.fontFamily": "Roboto Mono for Powerline",
"editor.fontSize": 11,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
@wsfuller
wsfuller / Search and Results
Created June 13, 2017 01:20
React Router v4 Redirect not working as expected
**Search**
export default class Search extends Component{
constructor(props){
super(props);
this.state = {
searchValue: '',
results:[]
}
this.handleKeyPress = this.handleKeyPress.bind(this);
function handleResponse(response){
console.log(response);
if(response.ok){
return response.json();
} else {
let error = new Error(response.statusText);
error.response = response;
throw error //uncaught (in promise) Error
@wsfuller
wsfuller / .gitignore
Created January 31, 2017 18:28
Running gitignore file for both Windows and Mac. Using JetBrains IDEs
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
@wsfuller
wsfuller / honeypot.md
Last active October 30, 2016 19:00
Honey Pot using HTML, JS, AJAX, and PHP

index.html

...
<form id="contactForm" method="GET" action="" class="contact-form" novalidate="novalidate">
  <div class="input-field col s12">
    <input name="name" type="text" id="name" class="validate" required/>
    <label for="name">Name</label>
router.post('/login', function(req, res){
User.findOne({ email: req.body.email }, function (err, user){
if (err){
res.send(err);
}
if(!user){
res.json({ success: false, message: 'Authentication failed. User not found'});
} else if (user) {
bcrypt.compare(req.body.password, user.password, function(err, res){
if(user.password != req.body.password){
var express = require('express');
var router = express.Router();
var jwt = require('jsonwebtoken');
var bcrypt = require('bcryptjs');
var hash = 'superSecret';
var config = require('../config/database');
User = require('../models/user.model.js');
// Create new User
var mongoose = require('mongoose');
// User Schema
var userSchema = mongoose.Schema({
email:{
type: String,
required: true,
unique: true
},
password:{
/* SASS / Social Media Brand Colors */
$twitter: #00aced;
$facebook: #3b5998;
$googleplus: #dd4b39;
$pinterest: #cb2027;
$linkedin: #007bb6;
$youtube: #bb0000;
$vimeo: #aad450;
$tumblr: #32506d;
preferred_syntax = :scss
http_path = '/'
css_dir = 'css'
sass_dir = 'sass'
images_dir = 'images'
javascripts_dir = 'js'
relative_assets = true
line_comments = true
# output_style = :compressed