Skip to content

Instantly share code, notes, and snippets.

View skarthikeyan96's full-sized avatar
๐Ÿ˜Ž

Karthikeyan skarthikeyan96

๐Ÿ˜Ž
  • India
View GitHub Profile
@skarthikeyan96
skarthikeyan96 / install.txt
Last active August 20, 2019 06:22
gem install nokogiri - v 1.6.3.1 failing and mysql2
brew update
> brew install libxml2 libxslt libiconv
brew --prefix libxml2
/usr/local/opt/libxml2
brew --prefix libxslt
/usr/local/opt/libxslt
brew --prefix libiconv
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.4/redux.js"> </script>
console.log("data");
function foo(){
console.log("foo");
}
function bar(){
console.log("bar");
foo();
}
bar();
let obj = {
a : 2,
c : function(){
console.log("Inside the obj the value of a "+ this.a)
}
}
function dummy(callback){
callback();
let example ={
a:2,
b:"Example",
c:function(){
console.log(this)
}
}
example.c() // { a: 2, b: 'Example', c: [Function: c] }
a = 4 ;
function c(){
console.log(this.a)
}
example ={
a:2,
b:"Example",
c:function(){
console.log(this.a) // 2
}
@skarthikeyan96
skarthikeyan96 / Calculator.markdown
Last active January 13, 2019 13:15
Calculator Freecodecamp
class Clock extends React.Component { // create the Clock component using ES6 class
constructor(props) {
super(props);
this.state = {date: new Date()}; // initalise the state
}
render() { // data to be rendered goes inside the function
return ( /* getting the data from the props */
<div>
<h2> {this.state.date.toLocaleTimeString()}.</h2>
class Clock extends React.Component { // create the Clock component using ES6 class
constructor(props) {
super(props);
this.state = {date: new Date()}; // initalise the state
}
componentDidMount() { /* React Mount -- Setting up the timer when the DOM has been rendered to the screen */
this.timerID = setInterval(
() => this.tick(),
1000
//Requiring the package
"use strict";
let PouchDB = require('pouchdb');
let db = new PouchDB('test_db222');
console.log ("Database created Successfully.");
// You can get the basic information about the database using the method named info()