Skip to content

Instantly share code, notes, and snippets.

View formatkaka's full-sized avatar
🎯
Less to Read !!

Siddhant formatkaka

🎯
Less to Read !!
View GitHub Profile
@formatkaka
formatkaka / frontendDevlopmentBookmarks.md
Created March 22, 2016 12:37 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
import numpy as np
iris = load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
df['is_train'] = np.random.uniform(0, 1, len(df)) <= .75
df['species'] = pd.Categorical.from_codes(iris.target, iris.target_names)
df.head()
@formatkaka
formatkaka / javascript_best_practices.js
Last active August 17, 2017 19:10
Javascript best practices
////////////// 1 ////////////
//If using `parseInt` always specify the radix.
//Example - If we want to convert some string to number (assuming we aren't sure about what the string formaat can be.)
//If we want to convert it to decimal (radix - 10), we generally use
var mystring = '10';
var myinvalidstring = '0xff';
// if both values in the < comparison are strings,
// the comparison is made lexicographically (aka alphabetically like
// a dictionary). But if one or both is not a string,
// then both values are coerced to be numbers, and a typical numeric
// comparison occurs.
var a = 41;
var b = "42";
var c = "43";
a < b; // true
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.1.1/bootstrap-social.min.css" />
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<meta charset="utf-8">
</head>
<body>
const nlf = require('nlf');
const fs = require('fs');
// const stream = fs.createWriteStream('my_file.txt');
// to only include production dependencies
const filename = process.env.PUBLIC_DIR + 'licenses.json';
fs.writeFile(filename, '', () => {
console.log('done');
});
// modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles
parcelRequire = (function (modules, cache, entry, globalName) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof parcelRequire === 'function' && parcelRequire;