Skip to content

Instantly share code, notes, and snippets.

View saiumesh535's full-sized avatar
🤒
so long

sai umesh saiumesh535

🤒
so long
View GitHub Profile
@saiumesh535
saiumesh535 / AppleOrOrange.py
Last active July 17, 2017 06:13
Sklearn Python Example
# source https://www.youtube.com/watch?v=cKxRvEZd3Mw
from sklearn import tree;
# 0 for bumpy
# 1 for smooth
features = [[140,1], [130,1], [150,0], [170,0]]
#0 for apple
#1 for orange
labels = [0 ,0, 1, 1];
@saiumesh535
saiumesh535 / app.js
Last active June 27, 2017 10:57
MySQL connector or singleton for express node app
// getting connection from mysql.js file
// creating new mysql connection and checking it
const mysqlConnection = require('./model/mysql');
const mysql = require('mysql');
app.get('/testmysql', function(req, res) {
console.log(mysqlConnection.name);
mysqlConnection.createConnection().then((connection) => {
let query = "select * from zeus_user";
let table = [];
query = mysql.format(query, table);