This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs"); | |
var path = require('path'); | |
var writePath = '/home/saurabh/Documents/'; | |
var cmd=require('node-cmd'); | |
var async = require('async'); | |
var jsonfile = require('jsonfile'); | |
exports.fileupload = function(req,res){ | |
// console.log("req",req.files); | |
var filesArray = req.files; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './App.css'; | |
/* | |
Screen:LoginScreen | |
Loginscreen is the main screen which the user is shown on first visit to page and after | |
hitting logout | |
*/ | |
import LoginScreen from './Loginscreen'; | |
/* | |
Module:Material-UI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.username { | |
margin: auto; | |
color: #658585; | |
font-size: 1.53em; | |
font-family: "Coda", sans-serif; | |
font-weight: bold; | |
} | |
.avatar { | |
padding: .7em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom" | |
export default class User extends React.Component{ | |
render(){ | |
// console.log("userprops",this.props); | |
return ( | |
<div> | |
<img src={this.props.avatar} className="avatar"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import User from './User.js'; | |
export default class UserList extends React.Component{ | |
render(){ | |
if(Object.getOwnPropertyNames(this.props.users).length === 0){ | |
return (<div></div>) | |
} | |
var userNodes = this.props.users.map(function(user){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import {connect} from "react-redux"; | |
import UserList from './UserList.js' | |
import {fetchUsers} from "../actions/userActions.js" | |
@connect((store) => { | |
// console.log("ins store",store.userReducer.users); | |
return { |
NewerOlder