Skip to content

Instantly share code, notes, and snippets.

View smhatre59's full-sized avatar

Saurabh Mhatre smhatre59

View GitHub Profile
@smhatre59
smhatre59 / initialStateProject365.js
Created May 3, 2017 01:50
Inital State for redux reducer
import topicsJson from '../dbstore/topics.json';
const topicData = topicsJson.topics;
let topicNames = [];
for (var i in topicData) {
topicNames.push({
topicName: topicData[i].topicName,
topicDescription: topicData[i].topicDescription,
topicSummary: topicData[i].topicSummary,
imageurl: topicData[i].imageurl,
topicCategory: topicData[i].topicCategory,
@smhatre59
smhatre59 / cloudinarynodejsscript
Last active May 4, 2017 17:08
Nodejs script to upload files to cloudinary cdn
/*
Purpose:Upload files to cloudinary cdn from nodejs
Tutorial:http://wp.me/p82htC-eX
*/
const express = require('express');
let app = express();
const chokidar = require('chokidar');
const filepath = '/home/saurabh/Pictures/Apps/';
let watcher = chokidar.watch(filepath, {
@smhatre59
smhatre59 / User welcome screen
Created May 31, 2017 03:14
Screen to be displayed on first app launch
import React, { Component, PropTypes } from "react";
import {
AsyncStorage,
Modal,
View,
Text,
TouchableHighlight
} from "react-native";
import styles from "./styles/ftreScreenStyles";
export default class FtueScreen extends Component {
sampleTuple = (12, 10, 14, 18, 20, 22, 12)
#print a tuple
print(sampleTuple)
#Output: (12, 10, 14, 18, 20, 22, 12)
#print number of times 12 appears in the tuple
print(sampleTuple.count(12))
#Output: 2