Skip to content

Instantly share code, notes, and snippets.

View pshubham95's full-sized avatar

Shubham Patil pshubham95

View GitHub Profile
@pshubham95
pshubham95 / index.js
Created August 11, 2019 11:12
index.js configured with ondeviceready event
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
const renderReactDom = () => {
ReactDOM.render(<App />, document.getElementById('root'));
};
@pshubham95
pshubham95 / prebuild.js
Created August 9, 2019 21:54
Cordova prebuild hook
const path = require('path');
const { exec } = require('child_process');
const fs = require('fs');
const rimraf = require('rimraf');
function renameOutputFolder(buildFolderPath, outputFolderPath) {
return new Promise((resolve, reject) => {
fs.rename(buildFolderPath, outputFolderPath, (err) => {
if (err) {
reject(err);
@pshubham95
pshubham95 / package.json
Created August 9, 2019 11:48
cordovaReactProject
{
"name": "helloworld",
"displayName": "HelloCordova",
"version": "1.0.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.0.1"
@pshubham95
pshubham95 / package.json
Last active August 9, 2019 11:45
reactproject/package.json
{
"name": "reactproject",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.0.1"
},
"scripts": {
@pshubham95
pshubham95 / kmeansExample.py
Last active October 17, 2015 12:28 — forked from iandanforth/kmeansExample.py
A pure python implementation of K-Means clustering. Optional cluster visualization using plot.ly.
#############################################################################
# Full Imports
import sys
import math
import random
import subprocess
"""
This is a pure Python implementation of the K-Means Clustering algorithmn. The