Skip to content

Instantly share code, notes, and snippets.

View nodetop's full-sized avatar

John Richard nodetop

View GitHub Profile
@nodetop
nodetop / connectExample.js
Created October 3, 2018 05:16 — forked from webdevstar/connectExample.js
Redux connect example (dispatch & state)
import action from "../../Actions/MyAction";
import Cartbox from "./Cartbox";
import {bindActionCreators} from "redux";
import {connect} from "react-redux";
class Header extends Component {
constructor(props) {
super(props);
}
@nodetop
nodetop / filter.js
Created October 3, 2018 05:14 — forked from webdevstar/filter.js
Filter Example: All Social site(Facebook, Linkedin, VK etc ) filter way...
var countries = [];
var methods = [];
$(document).ready(function(){
function filter (){
$(".wm-courses-popular-wrap").parent().hide();
$(".wm-courses-popular-wrap").toArray().forEach((item) => {
const hasCountry = countries.length > 0 ? countries.indexOf($(item).attr('country')) > -1 : true;
const hasMethod = methods.length > 0 ? methods.indexOf($(item).attr('method')) > -1 : true;
if (hasCountry && hasMethod) {
@nodetop
nodetop / Keyevent.js
Created October 3, 2018 05:13 — forked from webdevstar/Keyevent.js
React Key events
handleKeyPress = (event) => {
if(event.key == 'Enter'){
console.log('enter press here! ')
}
}
render: function(){
return(
<div>
<input type="text" id="one" onKeyPress={this.handleKeyPress} />
</div>