├── React Native ├── AwesomeRedux │ ├── .watchmanconfig │ ├── .gitattributes │ ├── .babelrc │ ├── app.json │ ├── android │ │ ├── settings.gradle │ │ ├── app │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── awesomeredux │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ │ └── AndroidManifest.xml │ │ │ └── BUCK │ │ ├── keystores │ │ │ ├── debug.keystore.properties │ │ │ └── BUCK │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── build.gradle │ │ └── gradle.properties │ ├── .buckconfig │ ├── src │ │ ├── component │ │ │ ├── index.js │ │ │ ├── app.js │ │ │ └── loginForm.js │ │ ├── common │ │ │ ├── index.js │ │ │ ├── Spinner.js │ │ │ ├── LibraryItem.js │ │ │ ├── CardSection.js │ │ │ ├── Card.js │ │ │ ├── Header.js │ │ │ ├── LibraryList.js │ │ │ ├── Button.js │ │ │ └── Input.js │ │ ├── reducer │ │ │ ├── index.js │ │ │ └── authReducer.js │ │ └── action │ │ │ └── authAction.js │ ├── index.ios.js │ ├── index.android.js │ ├── __tests__ │ │ ├── index.ios.js │ │ └── index.android.js │ ├── ios │ │ ├── AwesomeRedux │ │ │ ├── AppDelegate.h │ │ │ ├── main.m │ │ │ ├── Images.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── AppDelegate.m │ │ │ └── Info.plist │ │ ├── AwesomeReduxTests │ │ │ └── Info.plist │ │ ├── AwesomeRedux-tvOSTests │ │ │ └── Info.plist │ │ └── AwesomeRedux-tvOS │ │ │ └── Info.plist │ ├── package.json │ ├── .gitignore │ └── .flowconfig ├── AwesomeCamera │ ├── .watchmanconfig │ ├── .gitattributes │ ├── .babelrc │ ├── app.json │ ├── android │ │ ├── app │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── capturepicture │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ │ └── AndroidManifest.xml │ │ │ └── BUCK │ │ ├── keystores │ │ │ ├── debug.keystore.properties │ │ │ └── BUCK │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── settings.gradle │ │ ├── build.gradle │ │ └── gradle.properties │ ├── .buckconfig │ ├── __tests__ │ │ ├── index.ios.js │ │ └── index.android.js │ ├── ios │ │ ├── capturePicture │ │ │ ├── AppDelegate.h │ │ │ ├── main.m │ │ │ ├── Images.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── AppDelegate.m │ │ │ └── Info.plist │ │ ├── capturePictureTests │ │ │ └── Info.plist │ │ ├── capturePicture-tvOSTests │ │ │ └── Info.plist │ │ └── capturePicture-tvOS │ │ │ └── Info.plist │ ├── package.json │ ├── .gitignore │ ├── index.ios.js │ ├── .flowconfig │ └── index.android.js └── AwesomeNavigation │ ├── .watchmanconfig │ ├── .gitattributes │ ├── .babelrc │ ├── android │ ├── settings.gradle │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── awesomenavigation │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ └── BUCK │ ├── keystores │ │ ├── debug.keystore.properties │ │ └── BUCK │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ └── gradle.properties │ ├── app.json │ ├── .buckconfig │ ├── src │ ├── index.js │ ├── common │ │ ├── index.js │ │ ├── Spinner.js │ │ ├── LibraryItem.js │ │ ├── CardSection.js │ │ ├── Card.js │ │ ├── Header.js │ │ ├── LibraryList.js │ │ ├── Button.js │ │ └── Input.js │ ├── about.js │ └── home.js │ ├── __tests__ │ ├── index.ios.js │ └── index.android.js │ ├── ios │ ├── AwesomeNavigation │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.m │ │ └── Info.plist │ ├── AwesomeNavigationTests │ │ └── Info.plist │ ├── AwesomeNavigation-tvOSTests │ │ └── Info.plist │ └── AwesomeNavigation-tvOS │ │ └── Info.plist │ ├── package.json │ ├── .gitignore │ ├── index.ios.js │ ├── index.android.js │ └── .flowconfig ├── Learn server ├── 03 │ ├── Express │ │ ├── .gitignore │ │ ├── app.js │ │ └── package.json │ ├── Middleware │ │ └── basic samples │ │ │ ├── .gitignore │ │ │ ├── exm │ │ │ ├── img.jpg │ │ │ ├── Thumbs.db │ │ │ └── hm.txt │ │ │ ├── app_simple.js │ │ │ ├── package.json │ │ │ ├── app_sample2.js │ │ │ ├── app_sample3.js │ │ │ └── route-example.js │ └── NodeJS │ │ ├── reading_file_async │ │ ├── myfile.txt │ │ ├── package.json │ │ └── app.js │ │ └── node_Server_routing │ │ ├── .gitignore │ │ ├── package.json │ │ └── app.js ├── 04 │ ├── Express │ │ ├── .gitignore │ │ ├── app.js │ │ └── package.json │ ├── Template │ │ ├── .gitignore │ │ ├── views │ │ │ └── index.ejs │ │ ├── package.json │ │ ├── app.js │ │ └── body_parser.js │ ├── Middleware │ │ └── basic samples │ │ │ ├── .gitignore │ │ │ ├── exm │ │ │ ├── img.jpg │ │ │ ├── Thumbs.db │ │ │ └── hm.txt │ │ │ ├── app_simple.js │ │ │ ├── package.json │ │ │ ├── app_sample2.js │ │ │ ├── app_sample3.js │ │ │ └── route-example.js │ └── NodeJS │ │ ├── reading_file_async │ │ ├── myfile.txt │ │ ├── package.json │ │ └── app.js │ │ └── node_Server_routing │ │ ├── .gitignore │ │ ├── package.json │ │ └── app.js ├── 05 │ └── Create GuesstBook │ │ ├── .gitignore │ │ ├── views │ │ ├── footer.ejs │ │ ├── 404.ejs │ │ ├── index.ejs │ │ ├── header.ejs │ │ └── new-entry.ejs │ │ ├── package.json │ │ └── app.js ├── 01 │ ├── .gitignore │ ├── input.txt │ ├── exports.js │ └── package.json ├── 02 │ └── Saturday │ │ ├── .gitignore │ │ ├── package.json │ │ └── app.js ├── 09 │ ├── client-side │ │ ├── src │ │ │ ├── index.css │ │ │ ├── App.test.js │ │ │ ├── index.js │ │ │ ├── App.css │ │ │ └── App.js │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── manifest.json │ │ │ └── index.html │ │ ├── .gitignore │ │ └── package.json │ └── server-side │ │ ├── .gitignore │ │ └── package.json ├── 00book │ └── Express_in_Action_v10_MEAP.pdf ├── firebase functions │ ├── package.json │ └── index.js ├── 06 │ └── Promices │ │ ├── Promice │ │ ├── myModule.js │ │ ├── app.js │ │ └── package.json │ │ ├── Practice2 │ │ ├── package.json │ │ └── app.js │ │ └── Practice1 │ │ └── app.js ├── 08 │ └── mongoose CRUD │ │ └── package.json └── 07 │ └── mongoose basic │ ├── package.json │ └── app.js ├── React Native EXPO ├── my-application-naitive │ ├── .watchmanconfig │ ├── .gitignore │ ├── app.json │ ├── .babelrc │ ├── App.test.js │ ├── src │ │ └── components │ │ │ └── Home.js │ ├── package.json │ ├── App.js │ └── .flowconfig └── firebase-Authantication │ ├── .watchmanconfig │ ├── .gitignore │ ├── app.json │ ├── src │ └── components │ │ ├── index.js │ │ └── common │ │ ├── index.js │ │ ├── Spinner.js │ │ ├── CardSection.js │ │ ├── Card.js │ │ ├── Header.js │ │ ├── Button.js │ │ └── Input.js │ ├── .babelrc │ ├── App.test.js │ ├── package.json │ ├── App.js │ └── .flowconfig ├── 4-Apr-17-redux lab ├── src │ ├── index.css │ ├── action.js │ ├── App.test.js │ ├── reducer │ │ ├── counterReducer.js │ │ └── authReducer.js │ ├── App.css │ ├── App.js │ └── index.js ├── public │ ├── favicon.ico │ └── index.html ├── .gitignore └── package.json ├── 18-Mar-17 - todo-firebase ├── src │ ├── index.css │ ├── App.test.js │ ├── index.js │ ├── App.css │ └── App.js ├── public │ ├── favicon.ico │ └── index.html ├── .gitignore └── package.json ├── 2-Apr-17 = redux+authFirebase ├── src │ ├── index.css │ ├── App.test.js │ ├── components │ │ ├── app │ │ │ ├── App.css │ │ │ └── App.js │ │ ├── home.js │ │ └── login │ │ │ └── login.js │ ├── index.js │ ├── store │ │ ├── index.js │ │ ├── authReduces │ │ │ └── authReducer.js │ │ └── action │ │ │ └── authAction.js │ └── Routes.js ├── public │ ├── favicon.ico │ └── index.html ├── .gitignore └── package.json ├── 5-Mar-17 ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── index.js │ └── compoents │ │ ├── home.js │ │ └── app.js ├── .gitignore └── package.json ├── 12-Mar-17 ├── public │ ├── favicon.ico │ └── index.html ├── .gitignore ├── src │ ├── index.js │ └── component │ │ └── App.js └── package.json └── 26-Mar-17 = routing+firebaseAuthantication ├── src ├── index.css ├── App.test.js ├── index.js ├── components │ ├── app │ │ ├── App.css │ │ └── App.js │ ├── home.js │ ├── login │ │ └── login.js │ └── signup │ │ └── signup.js └── Routes.js ├── public ├── favicon.ico └── index.html ├── .gitignore └── package.json /React Native/AwesomeRedux/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Learn server/03/Express/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Learn server/04/Express/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Learn server/04/Template/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /React Native/AwesomeCamera/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Learn server/03/NodeJS/reading_file_async/myfile.txt: -------------------------------------------------------------------------------- 1 | x = a + b; -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Learn server/04/NodeJS/reading_file_async/myfile.txt: -------------------------------------------------------------------------------- 1 | x = a + b; -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /Learn server/03/NodeJS/node_Server_routing/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Learn server/04/NodeJS/node_Server_routing/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /Learn server/01/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | npm-debug.* 4 | -------------------------------------------------------------------------------- /Learn server/02/Saturday/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | npm-debug.* 4 | -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/views/footer.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | npm-debug.* 4 | -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | npm-debug.* 4 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AwesomeRedux", 3 | "displayName": "AwesomeRedux" 4 | } -------------------------------------------------------------------------------- /React Native/AwesomeCamera/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "capturePicture", 3 | "displayName": "capturePicture" 4 | } -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'AwesomeRedux' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "sdkVersion": "16.0.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "sdkVersion": "16.0.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'AwesomeNavigation' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AwesomeNavigation", 3 | "displayName": "AwesomeNavigation" 4 | } -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/views/404.ejs: -------------------------------------------------------------------------------- 1 | <% include header %> 2 |

404! Page not found.

3 | <% include footer %> -------------------------------------------------------------------------------- /Learn server/09/client-side/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/index.js: -------------------------------------------------------------------------------- 1 | export * from './signupForm' 2 | export * from './loginForm' -------------------------------------------------------------------------------- /5-Mar-17/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/5-Mar-17/public/favicon.ico -------------------------------------------------------------------------------- /Learn server/01/input.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/Learn server/01/input.txt -------------------------------------------------------------------------------- /12-Mar-17/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/12-Mar-17/public/favicon.ico -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/4-Apr-17-redux lab/public/favicon.ico -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AwesomeRedux 3 | 4 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | capturePicture 3 | 4 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/18-Mar-17 - todo-firebase/public/favicon.ico -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AwesomeNavigation 3 | 4 | -------------------------------------------------------------------------------- /Learn server/09/client-side/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/Learn server/09/client-side/public/favicon.ico -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/2-Apr-17 = redux+authFirebase/public/favicon.ico -------------------------------------------------------------------------------- /Learn server/03/NodeJS/reading_file_async/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "start": "node app" 5 | }, 6 | "dependencies": { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Learn server/04/NodeJS/reading_file_async/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "start": "node app" 5 | }, 6 | "dependencies": { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Learn server/00book/Express_in_Action_v10_MEAP.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/Learn server/00book/Express_in_Action_v10_MEAP.pdf -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/exm/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/Learn server/03/Middleware/basic samples/exm/img.jpg -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/exm/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/Learn server/04/Middleware/basic samples/exm/img.jpg -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Learn server/01/exports.js: -------------------------------------------------------------------------------- 1 | function myFunc(params) { 2 | console.log(params) 3 | console.log("Saylani mass training pro..........") 4 | } 5 | 6 | 7 | 8 | module.exports = myFunc -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/exm/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/Learn server/03/Middleware/basic samples/exm/Thumbs.db -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/exm/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/Learn server/04/Middleware/basic samples/exm/Thumbs.db -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/component/index.js: -------------------------------------------------------------------------------- 1 | import { AppComponent } from './app' 2 | import LoginForm from './loginForm' 3 | 4 | export { 5 | AppComponent, 6 | LoginForm 7 | } -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/index.js: -------------------------------------------------------------------------------- 1 | import { HomeComponent } from './home' 2 | import { AboutComponent } from './about' 3 | 4 | export { 5 | HomeComponent, 6 | AboutComponent 7 | } -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/26-Mar-17 = routing+firebaseAuthantication/public/favicon.ico -------------------------------------------------------------------------------- /React Native/AwesomeRedux/index.ios.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import { AppComponent } from './src' 3 | 4 | AppRegistry.registerComponent('AwesomeRedux', () => AppComponent); 5 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-expo"], 3 | "env": { 4 | "development": { 5 | "plugins": ["transform-react-jsx-source"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-expo"], 3 | "env": { 4 | "development": { 5 | "plugins": ["transform-react-jsx-source"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeRedux/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /5-Mar-17/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './compoents/app'; 4 | 5 | ReactDOM.render( 6 | , 7 | document.getElementById('root') 8 | ); 9 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeCamera/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /React Native/AwesomeRedux/index.android.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import { AppComponent } from './src/component' 3 | 4 | AppRegistry.registerComponent('AwesomeRedux', () => AppComponent); 5 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeNavigation/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/index.js: -------------------------------------------------------------------------------- 1 | export * from './Button'; 2 | export * from './Card'; 3 | export * from './CardSection'; 4 | export * from './Header'; 5 | export * from './Input'; 6 | export * from './Spinner'; -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/index.js: -------------------------------------------------------------------------------- 1 | export * from './Button'; 2 | export * from './Card'; 3 | export * from './CardSection'; 4 | export * from './Header'; 5 | export * from './Input'; 6 | export * from './Spinner'; -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/reducer/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | import { AuthReducer } from './authReducer' 3 | 4 | export default combineReducers({ 5 | authanticationReducer: AuthReducer 6 | }) -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeCamera/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeCamera/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeRedux/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeRedux/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeRedux/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/action.js: -------------------------------------------------------------------------------- 1 | 2 | export class ActionSample { 3 | static SIGNIN = 'SIGNIN' 4 | static SIGNUP = 'SIGNUP' 5 | 6 | 7 | static INC = 'INC' 8 | static DEC = 'DEC' 9 | 10 | 11 | 12 | 13 | 14 | } -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeCamera/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeCamera/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeRedux/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeNavigation/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeNavigation/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeNavigation/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-majid-ashrafi/Saylani_theory_batch4/master/React Native/AwesomeNavigation/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /Learn server/firebase functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "dependencies": { 5 | "firebase-admin": "~4.2.1", 6 | "firebase-functions": "^0.5.7" 7 | }, 8 | "private": true 9 | } 10 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'capturePicture' 2 | include ':react-native-camera' 3 | project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') 4 | 5 | include ':app' 6 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /Learn server/09/client-side/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /Learn server/03/Express/app.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var app = express(); 3 | 4 | app.get("/", function (request, response) { 5 | response.send("Hello world!"); 6 | }); 7 | app.listen(3000, function () { 8 | console.log("Express app started on port 3000."); 9 | }); 10 | -------------------------------------------------------------------------------- /Learn server/04/Express/app.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var app = express(); 3 | 4 | app.get("/", function (request, response) { 5 | response.send("Hello world!"); 6 | }); 7 | app.listen(3000, function () { 8 | console.log("Express app started on port 3000."); 9 | }); 10 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/common/index.js: -------------------------------------------------------------------------------- 1 | export * from './Header' 2 | // export * from './List' 3 | export * from './Card' 4 | export * from './CardSection' 5 | export * from './Button' 6 | export * from './Input' 7 | export * from './Spinner' 8 | // import {} from './home' -------------------------------------------------------------------------------- /Learn server/06/Promices/Promice/myModule.js: -------------------------------------------------------------------------------- 1 | var q = require('q'); 2 | 3 | exports.myRandom = function () { 4 | 5 | var random = Math.random() 6 | var deferred = q.defer(); 7 | 8 | setTimeout(function () { 9 | deferred.resolve(random) 10 | }, 3000); 11 | 12 | return deferred.promise 13 | } -------------------------------------------------------------------------------- /5-Mar-17/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | -------------------------------------------------------------------------------- /Learn server/09/client-side/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import registerServiceWorker from './registerServiceWorker'; 6 | 7 | ReactDOM.render(, document.getElementById('root')); 8 | registerServiceWorker(); 9 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import App from './App'; 3 | 4 | import renderer from 'react-test-renderer'; 5 | 6 | it('renders without crashing', () => { 7 | const rendered = renderer.create().toJSON(); 8 | expect(rendered).toBeTruthy(); 9 | }); 10 | -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import App from './App'; 3 | 4 | import renderer from 'react-test-renderer'; 5 | 6 | it('renders without crashing', () => { 7 | const rendered = renderer.create().toJSON(); 8 | expect(rendered).toBeTruthy(); 9 | }); 10 | -------------------------------------------------------------------------------- /12-Mar-17/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | -------------------------------------------------------------------------------- /Learn server/01/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lab", 3 | "version": "1.0.0", 4 | "description": "learn nodejs with express", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "node app" 8 | }, 9 | "author": "majid", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.15.3" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Learn server/03/NodeJS/reading_file_async/app.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | fs.readFile("myfile.txt", function (err, data) { 3 | if (err) { 4 | console.error("Error reading file!"); 5 | return; 6 | } 7 | console.log(data.match(/x/gi).length + " letter X's"); 8 | }); 9 | console.log("Hello world!"); 10 | -------------------------------------------------------------------------------- /Learn server/04/NodeJS/reading_file_async/app.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | fs.readFile("myfile.txt", function (err, data) { 3 | if (err) { 4 | console.error("Error reading file!"); 5 | return; 6 | } 7 | console.log(data.match(/x/gi).length + " letter X's"); 8 | }); 9 | console.log("Hello world!"); 10 | -------------------------------------------------------------------------------- /Learn server/06/Promices/Promice/app.js: -------------------------------------------------------------------------------- 1 | var exp = require('express'); 2 | var myMod = require('./myModule') 3 | var app = exp(); 4 | 5 | app.get('/', function (req, res) { 6 | myMod.myRandom() 7 | .then(function (random) { 8 | res.send('This is Your Number ' + random) 9 | }) 10 | console.log('Run..') 11 | }).listen(3000) -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/action/authAction.js: -------------------------------------------------------------------------------- 1 | 2 | export const emailChanged = (text) => { 3 | return { 4 | type: 'EMAIL_CHANGED', 5 | payload: text 6 | } 7 | } 8 | 9 | export const passwordChange = (text) => { 10 | return { 11 | type: 'PASSWORD_CHANGED', 12 | payload: text 13 | } 14 | } -------------------------------------------------------------------------------- /Learn server/06/Promices/Practice2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "q": "^1.4.1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/app_simple.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var http = require("http"); 3 | var app = express(); 4 | 5 | app.use(function (request, response) { 6 | response.writeHead(200, { "Content-Type": "text/plain" }); 7 | response.end("Hello, World!"); 8 | }); 9 | http.createServer(app).listen(3000); 10 | -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/app_simple.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var http = require("http"); 3 | var app = express(); 4 | 5 | app.use(function (request, response) { 6 | response.writeHead(200, { "Content-Type": "text/plain" }); 7 | response.end("Hello, World!"); 8 | }); 9 | http.createServer(app).listen(3000); 10 | -------------------------------------------------------------------------------- /Learn server/02/Saturday/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lab", 3 | "version": "1.0.0", 4 | "description": "learn nodejs with express", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "node app" 8 | }, 9 | "author": "majid", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.15.3", 13 | "morgan": "^1.8.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Learn server/06/Promices/Promice/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.13.3", 13 | "q": "^1.4.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import './index.css'; 5 | import firebase from 'firebase' 6 | 7 | // Initialize Firebase 8 | var config = { 9 | 10 | }; 11 | firebase.initializeApp(config); 12 | 13 | ReactDOM.render( 14 | , 15 | document.getElementById('root') 16 | ); 17 | -------------------------------------------------------------------------------- /Learn server/03/NodeJS/node_Server_routing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "basic example", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "MAjid ashraf", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.15.3" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Learn server/04/NodeJS/node_Server_routing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "basic example", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "MAjid ashraf", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.15.3" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /Learn server/04/Template/views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hello, world 7 | 8 | 9 | 10 |

11 | <%= message %> 12 |

13 |
    14 |
  • Name : 15 | <%= myName %> 16 |
  • 17 |
  • Age : 18 | <%= age %> 19 |
  • 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/src/components/Home.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { View, Text } from 'react-native' 3 | 4 | export const HomeComponent = ({demo}) => { 5 | console.log(demo) 6 | return ( 7 | 8 | 9 | {demo} 10 | 11 | 12 | ) 13 | } 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Learn server/09/client-side/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "v", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "body-parser": "^1.14.1", 13 | "ejs": "^2.3.4", 14 | "express": "^4.13.3" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Learn server/09/client-side/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /Learn server/09/server-side/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /5-Mar-17/src/compoents/home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | 4 | export class Home extends Component { 5 | constructor(props) { 6 | super(props) 7 | this.state = { 8 | name: props.myName 9 | } 10 | } 11 | render() { 12 | return ( 13 |
14 | Hello {this.state.name} 15 |
16 | ) 17 | } 18 | } -------------------------------------------------------------------------------- /Learn server/04/Template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "template", 3 | "version": "1.0.0", 4 | "description": "example ejs tamplate", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "body-parser": "^1.17.2", 13 | "ejs": "^2.5.6", 14 | "express": "^4.15.3" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/reducer/counterReducer.js: -------------------------------------------------------------------------------- 1 | import { ActionSample } from '../action' 2 | 3 | // const INITIAL_STATE = { 4 | 5 | // } 6 | 7 | export const countReducer = (state = 0, action) => { 8 | switch (action.type) { 9 | case ActionSample.INC: 10 | return state + 1 11 | case ActionSample.DEC: 12 | return state - 1 13 | default: 14 | return state 15 | } 16 | } -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/common/Spinner.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { View, Text, ActivityIndicator } from 'react-native' 3 | 4 | export const Spinner = (props) => { 5 | return ( 6 | 7 | 8 | 9 | ) 10 | } 11 | 12 | const styleSpinner = { 13 | flex: 1, 14 | justifyContent: 'center' 15 | } 16 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import Routes from './Routes'; 4 | import './index.css'; 5 | 6 | 7 | 8 | import firebase from 'firebase' 9 | 10 | // Initialize Firebase 11 | var config = { 12 | 13 | }; 14 | firebase.initializeApp(config); 15 | 16 | 17 | 18 | ReactDOM.render( 19 | , 20 | document.getElementById('root') 21 | ); 22 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/about.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { View, Text } from 'react-native' 3 | 4 | 5 | export class AboutComponent extends Component { 6 | render() { 7 | alert("Thank you!") 8 | return ( 9 | 10 | 11 | Hello About Component 12 | 13 | 14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /5-Mar-17/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "exampleApp", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "0.9.3" 7 | }, 8 | "dependencies": { 9 | "react": "^15.4.2", 10 | "react-dom": "^15.4.2" 11 | }, 12 | "scripts": { 13 | "start": "react-scripts start", 14 | "build": "react-scripts build", 15 | "test": "react-scripts test --env=jsdom", 16 | "eject": "react-scripts eject" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /12-Mar-17/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './component/App'; 4 | 5 | import firebase from 'firebase' 6 | 7 | 8 | // Initialize Firebase 9 | var config = { 10 | apiKey: "", 11 | authDomain: "", 12 | databaseURL: "", 13 | storageBucket: "", 14 | messagingSenderId: "" 15 | }; 16 | firebase.initializeApp(config); 17 | 18 | 19 | ReactDOM.render( 20 | , 21 | document.getElementById('root') 22 | ); 23 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /Learn server/09/client-side/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /12-Mar-17/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "12-Mar-17", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "0.9.5" 7 | }, 8 | "dependencies": { 9 | "firebase": "^3.7.1", 10 | "react": "^15.4.2", 11 | "react-dom": "^15.4.2" 12 | }, 13 | "scripts": { 14 | "start": "react-scripts start", 15 | "build": "react-scripts build", 16 | "test": "react-scripts test --env=jsdom", 17 | "eject": "react-scripts eject" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/components/app/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /Learn server/03/NodeJS/node_Server_routing/app.js: -------------------------------------------------------------------------------- 1 | var http = require("http"); 2 | function requestHandler(request, response) { 3 | if (request.url === "/") { 4 | response.end("Welcome to the homepage!"); 5 | } 6 | else if (request.url === "/about") { 7 | response.end("Welcome to the about page!"); 8 | } 9 | else { 10 | response.end("Error! File not found."); 11 | } 12 | } 13 | var server = http.createServer(requestHandler); 14 | server.listen(3000); 15 | -------------------------------------------------------------------------------- /Learn server/04/NodeJS/node_Server_routing/app.js: -------------------------------------------------------------------------------- 1 | var http = require("http"); 2 | function requestHandler(request, response) { 3 | if (request.url === "/") { 4 | response.end("Welcome to the homepage!"); 5 | } 6 | else if (request.url === "/about") { 7 | response.end("Welcome to the about page!"); 8 | } 9 | else { 10 | response.end("Error! File not found."); 11 | } 12 | } 13 | var server = http.createServer(requestHandler); 14 | server.listen(3000); 15 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reduxRouter", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "0.9.5" 7 | }, 8 | "dependencies": { 9 | "react": "^15.4.2", 10 | "react-dom": "^15.4.2", 11 | "redux": "^3.6.0" 12 | }, 13 | "scripts": { 14 | "start": "react-scripts start", 15 | "build": "react-scripts build", 16 | "test": "react-scripts test --env=jsdom", 17 | "eject": "react-scripts eject" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/components/app/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/components/home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Link } from 'react-router' 3 | 4 | 5 | class Home extends Component { 6 | render() { 7 | return ( 8 |
9 |

10 | Home page 11 |
12 | home 13 |

14 |
15 | ) 16 | } 17 | } 18 | 19 | 20 | export default Home; 21 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/java/com/awesomeredux/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.awesomeredux; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "AwesomeRedux"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/reducer/authReducer.js: -------------------------------------------------------------------------------- 1 | const InitialState = { 2 | email: '', 3 | password: '' 4 | } 5 | export const AuthReducer = (state = InitialState, action) => { 6 | // console.log('Reducer', action) 7 | switch (action.type) { 8 | case 'EMAIL_CHANGED': 9 | return { ...state, email: action.payload } 10 | case 'PASSWORD_CHANGED': 11 | return { ...state, password: action.payload } 12 | default: 13 | return state 14 | } 15 | } -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/views/index.ejs: -------------------------------------------------------------------------------- 1 | <% include header %> 2 | <% if (entries.length) { %> 3 | <% entries.forEach(function(entry) { %> 4 |
5 |
6 |
7 | <%= entry.published %> 8 |
9 | <%= entry.title %> 10 |
11 |
12 | <%= entry.content %> 13 |
14 |
15 | <% }) %> 16 | <% } else { %> 17 | No entries! Add one! 18 | <% } %> 19 | <% include footer %> -------------------------------------------------------------------------------- /Learn server/09/client-side/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client-side", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "1.0.10" 7 | }, 8 | "dependencies": { 9 | "axios": "^0.16.2", 10 | "react": "^15.6.1", 11 | "react-dom": "^15.6.1" 12 | }, 13 | "scripts": { 14 | "start": "react-scripts start", 15 | "build": "react-scripts build", 16 | "test": "react-scripts test --env=jsdom", 17 | "eject": "react-scripts eject" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/java/com/capturepicture/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.capturepicture; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "capturePicture"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todo-reactFirebase", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "0.9.5" 7 | }, 8 | "dependencies": { 9 | "firebase": "^3.7.2", 10 | "react": "^15.4.2", 11 | "react-dom": "^15.4.2" 12 | }, 13 | "scripts": { 14 | "start": "react-scripts start", 15 | "build": "react-scripts build", 16 | "test": "react-scripts test --env=jsdom", 17 | "eject": "react-scripts eject" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/components/app/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import logo from './logo.svg'; 3 | import './App.css'; 4 | 5 | class App extends Component { 6 | render() { 7 | return ( 8 |
9 |
10 | logo 11 |

Welcome to React

12 |
13 | {this.props.children} 14 |
15 | ) 16 | } 17 | } 18 | export default App; 19 | -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/exm/hm.txt: -------------------------------------------------------------------------------- 1 | //var app = express(); 2 | 3 | // view engine setup 4 | //app.set('views', path.join(__dirname, 'views')); 5 | //app.set('view engine', 'ejs'); 6 | 7 | // uncomment after placing your favicon in /public 8 | //app.use(favicon(__dirname + '/public/favicon.ico')); 9 | //app.use(logger('dev')); 10 | //app.use(bodyParser.json()); 11 | //app.use(bodyParser.urlencoded({ extended: false })); 12 | //app.use(cookieParser()); 13 | //app.use(express.static(path.join(__dirname, 'public'))); 14 | -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/exm/hm.txt: -------------------------------------------------------------------------------- 1 | //var app = express(); 2 | 3 | // view engine setup 4 | //app.set('views', path.join(__dirname, 'views')); 5 | //app.set('view engine', 'ejs'); 6 | 7 | // uncomment after placing your favicon in /public 8 | //app.use(favicon(__dirname + '/public/favicon.ico')); 9 | //app.use(logger('dev')); 10 | //app.use(bodyParser.json()); 11 | //app.use(bodyParser.urlencoded({ extended: false })); 12 | //app.use(cookieParser()); 13 | //app.use(express.static(path.join(__dirname, 'public'))); 14 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/java/com/awesomenavigation/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.awesomenavigation; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "AwesomeNavigation"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/components/app/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import logo from './logo.svg'; 3 | import './App.css'; 4 | 5 | class App extends Component { 6 | render() { 7 | return ( 8 |
9 |
10 | logo 11 |

Welcome to React

12 |
13 | {this.props.children} 14 |
15 | ) 16 | } 17 | } 18 | export default App; 19 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/Spinner.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, ActivityIndicator } from 'react-native'; 3 | 4 | const Spinner = ({ size }) => { 5 | return ( 6 | 7 | 8 | 9 | ) 10 | }; 11 | 12 | const styles = { 13 | spinnerStyle: { 14 | flex: 1, 15 | alignItems: 'center', 16 | justifyContent: 'center' 17 | } 18 | } 19 | 20 | 21 | 22 | export { Spinner }; -------------------------------------------------------------------------------- /5-Mar-17/src/compoents/app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Home } from './home' 3 | 4 | 5 | class App extends Component { 6 | constructor() { 7 | super() 8 | this.state = { 9 | name: "Majid", 10 | age: 34 11 | } 12 | } 13 | render() { 14 | return ( 15 |
16 | App.js 17 | 18 |
19 | ) 20 | } 21 | } 22 | 23 | export default App -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/Spinner.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, ActivityIndicator } from 'react-native'; 3 | 4 | export const Spinner = ({ size }) => { 5 | return ( 6 | 7 | 8 | 9 | ) 10 | }; 11 | 12 | const styles = { 13 | spinnerStyle: { 14 | flex: 1, 15 | alignItems: 'center', 16 | justifyContent: 'center' 17 | } 18 | } 19 | 20 | 21 | 22 | // export { Spinner }; -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import Routes from './Routes'; 4 | import { Provider } from 'react-redux' 5 | import { store } from './store' 6 | import './index.css'; 7 | 8 | 9 | 10 | import firebase from 'firebase' 11 | 12 | // Initialize Firebase 13 | var config = { 14 | 15 | }; 16 | firebase.initializeApp(config); 17 | 18 | 19 | 20 | ReactDOM.render( 21 | 22 | 23 | , 24 | document.getElementById('root') 25 | ); 26 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "router", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "0.9.5" 7 | }, 8 | "dependencies": { 9 | "firebase": "^3.7.3", 10 | "react": "^15.4.2", 11 | "react-dom": "^15.4.2", 12 | "react-router": "^3.0.2" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test --env=jsdom", 18 | "eject": "react-scripts eject" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/common/CardSection.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { View, Text } from 'react-native' 3 | 4 | export const CardSection = (props) => { 5 | return ( 6 | 7 | {props.children} 8 | 9 | ) 10 | } 11 | 12 | const styles = { 13 | borderBottomWidth: 1, 14 | padding: 5, 15 | backgroundColor: '#fff', 16 | justifyContent: 'flex-start', 17 | flexDirection: 'row', 18 | borderColor: '#ddd', 19 | position: 'relative' 20 | } -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/reducer/authReducer.js: -------------------------------------------------------------------------------- 1 | import { ActionSample } from '../action' 2 | 3 | const INITIAL_STATE = { 4 | isLogin: false, 5 | user: {} 6 | , isRegistered: false 7 | } 8 | 9 | export const authReducer = (state = INITIAL_STATE, action) => { 10 | switch (action.type) { 11 | case ActionSample.SIGNUP: 12 | return state = { isRegistered: true, user: action.value } 13 | case ActionSample.SIGNIN: 14 | return state = { isLogin: true } 15 | default: 16 | return state 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Learn server/03/Express/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hell0o", 3 | "version": "1.0.0", 4 | "description": "hello world in express framework", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node app" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/tree/master/Learn%20server" 13 | }, 14 | "author": "majid ashraf", 15 | "license": "ISC", 16 | "dependencies": { 17 | "express": "^4.15.3" 18 | } 19 | } -------------------------------------------------------------------------------- /Learn server/04/Express/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hell0o", 3 | "version": "1.0.0", 4 | "description": "hello world in express framework", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node app" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/tree/master/Learn%20server" 13 | }, 14 | "author": "majid ashraf", 15 | "license": "ISC", 16 | "dependencies": { 17 | "express": "^4.15.3" 18 | } 19 | } -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeRedux/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePicture/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Learn server/04/Template/app.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var http = require("http"); 3 | var path = require("path"); 4 | var app = express(); 5 | 6 | // app.set()//where and what 7 | app.set("views", path.resolve(__dirname, "views")); 8 | app.set("view engine", "ejs"); 9 | 10 | app.get("/", function (request, response) { 11 | response.render("index", { 12 | message: "Hey everyone! This is my webpage.", 13 | myName: "Ali Mughal", 14 | age: "30", 15 | post: 'Manager' 16 | }); 17 | }); 18 | http.createServer(app).listen(3000); 19 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigation/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "middleware", 3 | "version": "1.0.0", 4 | "description": "express middleware examples", 5 | "main": "app-simple.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/tree/master/Learn%20server" 12 | }, 13 | "author": "Majid ashraf", 14 | "license": "ISC", 15 | "dependencies": { 16 | "express": "^4.15.3", 17 | "morgan": "^1.8.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "middleware", 3 | "version": "1.0.0", 4 | "description": "express middleware examples", 5 | "main": "app-simple.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/tree/master/Learn%20server" 12 | }, 13 | "author": "Majid ashraf", 14 | "license": "ISC", 15 | "dependencies": { 16 | "express": "^4.15.3", 17 | "morgan": "^1.8.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import logo from './logo.svg'; 3 | import './App.css'; 4 | 5 | class App extends Component { 6 | render() { 7 | return ( 8 |
9 |
10 | logo 11 |

Welcome to React

12 |
13 |

14 | To get started, edit src/App.js and save to reload. 15 |

16 |
17 | ); 18 | } 19 | } 20 | 21 | export default App; 22 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "capturePicture", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "16.0.0-alpha.6", 11 | "react-native": "0.44.2", 12 | "react-native-camera": "^0.9.0" 13 | }, 14 | "devDependencies": { 15 | "babel-jest": "20.0.3", 16 | "babel-preset-react-native": "1.9.2", 17 | "jest": "20.0.4", 18 | "react-test-renderer": "16.0.0-alpha.6" 19 | }, 20 | "jest": { 21 | "preset": "react-native" 22 | } 23 | } -------------------------------------------------------------------------------- /Learn server/firebase functions/index.js: -------------------------------------------------------------------------------- 1 | const functions = require('firebase-functions'); 2 | 3 | // // Create and Deploy Your First Cloud Functions 4 | // // https://firebase.google.com/docs/functions/write-firebase-functions 5 | // 6 | exports.helloWorld = functions.https.onRequest((request, response) => { 7 | response.send("Hello from Firebase 123 !"); 8 | }); 9 | // 10 | exports.authFunction = functions.https.onRequest((request, response) => { 11 | var obj = { 12 | name: "Majid",//request.body.name, 13 | email: "ex@gmail.com"//request.body.email 14 | } 15 | response.send(obj); 16 | }); 17 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AwesomeNavigation", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "16.0.0-alpha.6", 11 | "react-native": "0.44.2", 12 | "react-navigation": "^1.0.0-beta.11" 13 | }, 14 | "devDependencies": { 15 | "babel-jest": "20.0.3", 16 | "babel-preset-react-native": "1.9.2", 17 | "jest": "20.0.4", 18 | "react-test-renderer": "16.0.0-alpha.6" 19 | }, 20 | "jest": { 21 | "preset": "react-native" 22 | } 23 | } -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePicture/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeRedux/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigation/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "router", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "0.9.5" 7 | }, 8 | "dependencies": { 9 | "firebase": "^3.7.3", 10 | "react": "^15.4.2", 11 | "react-dom": "^15.4.2", 12 | "react-redux": "^5.0.3", 13 | "react-router": "^3.0.2", 14 | "redux": "^3.6.0", 15 | "redux-thunk": "^2.2.0" 16 | }, 17 | "scripts": { 18 | "start": "react-scripts start", 19 | "build": "react-scripts build", 20 | "test": "react-scripts test --env=jsdom", 21 | "eject": "react-scripts eject" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/LibraryItem.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Text } from 'react-native'; 3 | import { CardSection } from './'; 4 | 5 | class ListItem extends Component { 6 | 7 | render() { 8 | const {titleStyle} = styles; 9 | return ( 10 | 11 | {this.props.library.title} 12 | 13 | ) 14 | } 15 | 16 | } 17 | 18 | const styles ={ 19 | titleStyle : { 20 | fontSize: 18, 21 | paddingLeft: 15, 22 | 23 | } 24 | } 25 | 26 | export default ListItem; -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/views/header.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Express Guestbook 7 | 8 | 9 | 10 | 11 | 12 |
13 |

14 | Express Guestbook 15 | 16 | Write in the guestbook 17 | 18 |

-------------------------------------------------------------------------------- /React Native/AwesomeRedux/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AwesomeRedux", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "16.0.0-alpha.6", 11 | "react-native": "0.44.0", 12 | "react-redux": "^5.0.4", 13 | "redux": "^3.6.0", 14 | "redux-thunk": "^2.2.0" 15 | }, 16 | "devDependencies": { 17 | "babel-jest": "20.0.3", 18 | "babel-preset-react-native": "1.9.2", 19 | "jest": "20.0.3", 20 | "react-test-renderer": "16.0.0-alpha.6" 21 | }, 22 | "jest": { 23 | "preset": "react-native" 24 | } 25 | } -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/LibraryItem.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Text } from 'react-native'; 3 | import { CardSection } from './'; 4 | 5 | export class ListItem extends Component { 6 | 7 | render() { 8 | const {titleStyle} = styles; 9 | return ( 10 | 11 | {this.props.library.title} 12 | 13 | ) 14 | } 15 | 16 | } 17 | 18 | const styles ={ 19 | titleStyle : { 20 | fontSize: 18, 21 | paddingLeft: 15, 22 | 23 | } 24 | } 25 | 26 | // export default ListItem; -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/CardSection.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View } from 'react-native'; 3 | 4 | const CardSection = (props) => { 5 | return ( 6 | 7 | {props.children} 8 | 9 | ); 10 | } 11 | 12 | 13 | const styles = { 14 | containerStyle: { 15 | borderBottomWidth: 1, 16 | padding: 5, 17 | backgroundColor: '#fff', 18 | justifyContent: 'flex-start', 19 | flexDirection: 'row', 20 | borderColor: '#ddd', 21 | position: 'relative' 22 | 23 | } 24 | } 25 | 26 | export { CardSection }; 27 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/CardSection.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View } from 'react-native'; 3 | 4 | export const CardSection = (props) => { 5 | return ( 6 | 7 | {props.children} 8 | 9 | ); 10 | } 11 | 12 | 13 | const styles = { 14 | containerStyle: { 15 | borderBottomWidth: 1, 16 | padding: 5, 17 | backgroundColor: '#fff', 18 | justifyContent: 'flex-start', 19 | flexDirection: 'row', 20 | borderColor: '#ddd', 21 | position: 'relative' 22 | 23 | } 24 | } 25 | 26 | // export { CardSection }; 27 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/common/Card.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { View, Text } from 'react-native' 3 | 4 | export const Card = (props) => { 5 | return ( 6 | 7 | {props.children} 8 | 9 | ) 10 | } 11 | 12 | const styles = { 13 | borderWidth: 1, 14 | borderRadius: 2, 15 | borderColor: '#ddd', 16 | borderBottomWidth: 0, 17 | shadowColor: '#000', 18 | shadowOffset: { width: 0, height: 2 }, 19 | shadowOpacity: 0.1, 20 | shadowRadius: 2, 21 | elevation: 1, 22 | marginLeft: 5, 23 | marginRight: 5, 24 | marginTop: 10 25 | } -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/app_sample2.js: -------------------------------------------------------------------------------- 1 | var express = require('express') // Import express module from node_modules 2 | var http = require('http') // Import http module from node_modules 3 | var app = express() // call express function which means return req.handlerFunction 4 | 5 | app.use(function (request, response, next) { 6 | console.log("run middleware") 7 | next() 8 | }) 9 | 10 | app.use(function (request, response,next) { 11 | console.log("run middleware2121121") 12 | next() 13 | }) 14 | 15 | app.get('/', (request, response) => { 16 | response.send("helle world") 17 | }) 18 | 19 | http.createServer(app).listen(3000); 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/app_sample2.js: -------------------------------------------------------------------------------- 1 | var express = require('express') // Import express module from node_modules 2 | var http = require('http') // Import http module from node_modules 3 | var app = express() // call express function which means return req.handlerFunction 4 | 5 | app.use(function (request, response, next) { 6 | console.log("run middleware") 7 | next() 8 | }) 9 | 10 | app.use(function (request, response,next) { 11 | console.log("run middleware2121121") 12 | next() 13 | }) 14 | 15 | app.get('/', (request, response) => { 16 | response.send("helle world") 17 | }) 18 | 19 | http.createServer(app).listen(3000); 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/app_sample3.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var logger = require("morgan"); 3 | var http = require("http"); 4 | var app = express(); 5 | 6 | app.use(logger("short")); 7 | 8 | app.use(function (request, response, next) { 9 | var minute = (new Date()).getMinutes(); 10 | if ((minute % 2) === 0) { 11 | next(); 12 | } 13 | else { 14 | response.statusCode = 403; 15 | response.end("Not authorized."); 16 | } 17 | }); 18 | app.use(function (request, response) { 19 | response.writeHead(200, { "Content-Type": "text/plain" }); 20 | response.end("User Authanticated :)"); 21 | }); 22 | http.createServer(app).listen(3000); 23 | -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/app_sample3.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var logger = require("morgan"); 3 | var http = require("http"); 4 | var app = express(); 5 | 6 | app.use(logger("short")); 7 | 8 | app.use(function (request, response, next) { 9 | var minute = (new Date()).getMinutes(); 10 | if ((minute % 2) === 0) { 11 | next(); 12 | } 13 | else { 14 | response.statusCode = 403; 15 | response.end("Not authorized."); 16 | } 17 | }); 18 | app.use(function (request, response) { 19 | response.writeHead(200, { "Content-Type": "text/plain" }); 20 | response.end("User Authanticated :)"); 21 | }); 22 | http.createServer(app).listen(3000); 23 | -------------------------------------------------------------------------------- /Learn server/08/mongoose CRUD/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "description": "mongoose examples", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4.git" 12 | }, 13 | "author": "Saylani", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/issues" 17 | }, 18 | "homepage": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4#readme", 19 | "dependencies": { 20 | "mongoose": "^4.11.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Learn server/07/mongoose basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "description": "mongoose examples", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4.git" 12 | }, 13 | "author": "Majid Ashraf", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/issues" 17 | }, 18 | "homepage": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4#readme", 19 | "dependencies": { 20 | "mongoose": "^4.11.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/views/new-entry.ejs: -------------------------------------------------------------------------------- 1 | <% include header %> 2 | 3 |

Write a new entry

4 | 5 |
6 | 7 |
8 |
9 | 10 | 11 |
12 | 13 |
14 | 15 | 16 |
17 | 18 |
19 | 20 |
21 |
22 | <% include footer %> -------------------------------------------------------------------------------- /12-Mar-17/src/component/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import firebase from 'firebase' 3 | 4 | 5 | class App extends Component { 6 | 7 | componentWillMount() { 8 | const obj = { 9 | name: "Majid", 10 | id: 11 11 | } 12 | var arr = firebase.database().ref().child('/saylani') 13 | arr.push(obj); 14 | } 15 | componentDidMount() { 16 | var arr = firebase.database().ref().child('/saylani') 17 | arr.on('value', (snapshot) => { 18 | console.log(snapshot.val()) 19 | }) 20 | } 21 | 22 | render() { 23 | return ( 24 |
25 |

Firebase Read/Write

26 |
27 | ); 28 | } 29 | } 30 | 31 | export default App; 32 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/component/app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { View, Text } from 'react-native' 3 | import { Provider } from 'react-redux' 4 | import { createStore, applyMiddleware } from 'redux' 5 | import ReduxThunk from 'redux-thunk' 6 | import reducers from '../reducer' 7 | import { LoginForm } from './' 8 | 9 | 10 | export class AppComponent extends Component { 11 | render() { 12 | return ( 13 | /* 14 | 15 | Hello World 16 | 17 | */ 18 | 19 | 20 | 21 | 22 | ) 23 | } 24 | } -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/Card.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View } from 'react-native'; 3 | 4 | 5 | export const Card = (props) => { 6 | // console.log(props.children); 7 | return ( 8 | 9 | {props.children} 10 | 11 | 12 | ); 13 | } 14 | 15 | const styles = { 16 | containerStyle: { 17 | borderWidth: 1, 18 | borderRadius: 2, 19 | borderColor: '#ddd', 20 | borderBottomWidth: 0, 21 | shadowOffset: { width: 0, height: 2 }, 22 | shadowOpacity: 0.1, 23 | shadowRadius: 2, 24 | elevation: 1, 25 | marginLeft: 5, 26 | marginRight: 5, 27 | marginTop: 10 28 | 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/Card.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View } from 'react-native'; 3 | 4 | 5 | const Card = (props) => { 6 | // console.log(props.children); 7 | return ( 8 | 9 | {props.children} 10 | 11 | 12 | ); 13 | } 14 | 15 | const styles = { 16 | containerStyle: { 17 | borderWidth: 1, 18 | borderRadius: 2, 19 | borderColor: '#ddd', 20 | borderBottomWidth: 0, 21 | shadowOffset: { width: 0, height: 2 }, 22 | shadowOpacity: 0.1, 23 | shadowRadius: 2, 24 | elevation: 1, 25 | marginLeft: 5, 26 | marginRight: 5, 27 | marginTop: 10 28 | 29 | } 30 | } 31 | 32 | export { Card }; 33 | -------------------------------------------------------------------------------- /Learn server/09/server-side/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "description": "mongoose examples", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start":"nodemon app" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4.git" 13 | }, 14 | "author": "Majid Ashraf", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/issues" 18 | }, 19 | "homepage": "https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4#readme", 20 | "dependencies": { 21 | "body-parser": "^1.17.2", 22 | "express": "^4.15.3", 23 | "mongoose": "^4.11.4" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeRedux/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePicture/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-application-naitive", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-native-scripts": "0.0.29", 7 | "jest-expo": "^0.4.0", 8 | "react-test-renderer": "16.0.0-alpha.6" 9 | }, 10 | "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js", 11 | "scripts": { 12 | "start": "react-native-scripts start", 13 | "eject": "react-native-scripts eject", 14 | "android": "react-native-scripts android", 15 | "ios": "react-native-scripts ios", 16 | "test": "node node_modules/jest/bin/jest.js --watch" 17 | }, 18 | "jest": { 19 | "preset": "jest-expo" 20 | }, 21 | "dependencies": { 22 | "expo": "^16.0.0", 23 | "react": "16.0.0-alpha.6", 24 | "react-native": "^0.43.4" 25 | } 26 | } -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigation/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firebase-Authantication", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-native-scripts": "0.0.29", 7 | "jest-expo": "^0.4.0", 8 | "react-test-renderer": "16.0.0-alpha.6" 9 | }, 10 | "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js", 11 | "scripts": { 12 | "start": "react-native-scripts start", 13 | "eject": "react-native-scripts eject", 14 | "android": "react-native-scripts android", 15 | "ios": "react-native-scripts ios", 16 | "test": "node node_modules/jest/bin/jest.js --watch" 17 | }, 18 | "jest": { 19 | "preset": "jest-expo" 20 | }, 21 | "dependencies": { 22 | "expo": "^16.0.0", 23 | "firebase": "^3.9.0", 24 | "react": "16.0.0-alpha.6", 25 | "react-native": "^0.43.4" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, View } from 'react-native'; 3 | 4 | 5 | const Header = (props) => { 6 | 7 | const { textStyle, viewStyle } = styles; 8 | return ( 9 | 10 | {props.headerText} 11 | 12 | 13 | ); 14 | 15 | }; 16 | 17 | 18 | const styles = { 19 | viewStyle: { 20 | backgroundColor: '#F8F8F8', 21 | justifyContent: 'center', 22 | alignItems: 'center', 23 | height: 60, 24 | paddingTop: 15, 25 | shadowColor: '#ff0000', 26 | shadowOffset: { width: 10, height: 20 }, 27 | shadowOpacity: 0.9, 28 | elevation: 2 29 | 30 | 31 | }, 32 | textStyle: { 33 | fontSize: 20 34 | } 35 | } 36 | 37 | export { Header }; 38 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, View } from 'react-native'; 3 | 4 | 5 | export const Header = (props) => { 6 | 7 | const { textStyle, viewStyle } = styles; 8 | return ( 9 | 10 | {props.headerText} 11 | 12 | 13 | ); 14 | 15 | }; 16 | 17 | 18 | const styles = { 19 | viewStyle: { 20 | backgroundColor: '#F8F8F8', 21 | justifyContent: 'center', 22 | alignItems: 'center', 23 | height: 60, 24 | paddingTop: 15, 25 | shadowColor: '#ff0000', 26 | shadowOffset: { width: 10, height: 20 }, 27 | shadowOpacity: 0.9, 28 | elevation: 2 29 | 30 | 31 | }, 32 | textStyle: { 33 | fontSize: 20 34 | } 35 | } 36 | 37 | // export { Header }; 38 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { View, Text } from 'react-native' 3 | import { CardSection, Button } from './common' 4 | 5 | 6 | export class HomeComponent extends Component { 7 | state = { isLoggedIn: true } 8 | goToNextPage() { 9 | const { navigate } = this.props.navigation; 10 | if (this.state.isLoggedIn) { 11 | navigate('About') 12 | } 13 | } 14 | render() { 15 | return ( 16 | /* 17 | 18 | Hello Home Component 19 | 20 | */ 21 | 22 | 23 | 24 | ) 25 | } 26 | } 27 | HomeComponent.navigationOptions = { 28 | title: 'Welcome Home', 29 | }; -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePictureTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeReduxTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePicture-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeRedux-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import { ActionSample } from './action' 5 | import { authReducer} from './reducer/authReducer' 6 | import { countReducer } from './reducer/counterReducer' 7 | 8 | // import { createStore, combineReducers } from 'redux' 9 | import { createStore, combineReducers } from 'redux' 10 | 11 | 12 | 13 | let store = createStore(combineReducers({authReducer , countReducer})) 14 | 15 | store.subscribe(() => { 16 | console.log("STORE CHANGED", store.getState()) 17 | }) 18 | 19 | store.dispatch({ 20 | type: ActionSample.SIGNUP, 21 | value: { name: "Majid", email: "mani@mani.com" } 22 | }) 23 | 24 | store.dispatch({ 25 | type: ActionSample.INC, 26 | // value : {name: "Majid",email : "mani@mani.com"} 27 | }) 28 | 29 | 30 | ReactDOM.render( 31 | , 32 | document.getElementById('root') 33 | ); 34 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/common/Header.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { View, Text } from 'react-native' 3 | 4 | 5 | export class Header extends Component { 6 | render() { 7 | return ( 8 | 9 | 10 | {this.props.headerText} 11 | 12 | ) 13 | } 14 | } 15 | 16 | const styles = { 17 | viewStyle: { 18 | backgroundColor: '#F8F8F8', 19 | justifyContent: 'center', 20 | alignItems: 'center', 21 | height: 60, 22 | paddingTop: 15, 23 | shadowColor: 'red', 24 | shadowOffset: { width: 0, height: 2 }, 25 | shadowOpacity: 0.2, 26 | elevation: 2, 27 | position: 'relative' 28 | }, 29 | textStyle: { 30 | fontSize: 20 31 | } 32 | } 33 | // export HomeComponent -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigation-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/Routes.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Router, Route, IndexRoute, browserHistory } from 'react-router' 3 | 4 | import App from './components/app/App'; 5 | import Login from './components/login/login'; 6 | import SignUp from './components/signup/signup'; 7 | import Home from './components/home'; 8 | 9 | class Routes extends Component { 10 | render() { 11 | return ( 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ) 23 | } 24 | } 25 | export default Routes; 26 | 27 | {/*npm install react-router@^3.0.2*/ } 28 | {/*npm install packge@version*/ } -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/store/index.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware, compose } from 'redux' 2 | // import { createStore } from 'redux' 3 | import thunk from 'redux-thunk' 4 | import { AuthReducer } from './authReduces/authReducer' 5 | 6 | // export const store = createStore(combineReducers({ AuthReducer }, {}, applyMiddleware(thunk))) 7 | ////////////////////////////// 8 | 9 | const middleware = compose( 10 | applyMiddleware(thunk) 11 | ); 12 | // const reducers = combineReducers({ 13 | // AuthReducer 14 | // //more reducers here 15 | // }) 16 | export const store = createStore( 17 | AuthReducer, 18 | middleware 19 | ) 20 | 21 | ///////////////////////// 22 | 23 | store.subscribe(() => { 24 | console.log("STORE CHANGED", store.getState()) 25 | }) 26 | // store.dispatch({ 27 | // type : 'SIGNUP', 28 | // value : "hwllo" 29 | // }) 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/common/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Text, TouchableOpacity } from 'react-native' 3 | 4 | export const Button = ({ onPress, children }) => { 5 | const { buttonStyle, textStyle } = styles 6 | return ( 7 | 8 | {children} 9 | 10 | ) 11 | } 12 | 13 | const styles = { 14 | textStyle: { 15 | alignSelf: 'center', 16 | color: '#007aff', 17 | fontSize: 16, 18 | fontWeight: '600', 19 | paddingTop: 10, 20 | paddingBottom: 10 21 | }, 22 | buttonStyle: { 23 | flex: 1, 24 | alignSelf: 'stretch', 25 | backgroundColor: '#fff', 26 | borderRadius: 5, 27 | borderWidth: 2, 28 | borderColor: '#007aff', 29 | marginLeft: 5, 30 | marginRight: 5 31 | } 32 | } -------------------------------------------------------------------------------- /Learn server/06/Promices/Practice1/app.js: -------------------------------------------------------------------------------- 1 | //Without promise function run karne k liye.. 2 | 3 | // A promise is an abstraction for asynchronous programming. 4 | // It's an object that proxies for the return value or the 5 | // exception thrown by a function that has to do some 6 | // asynchronous processing 7 | 8 | var result = "zero" 9 | console.log(result) 10 | functions(); 11 | console.log(result = 'Third') 12 | 13 | function functions() { 14 | console.log(result = 'Second'); 15 | setTimeout(myFunc, 4000) 16 | } 17 | 18 | function myFunc() { 19 | console.log('This is my Function.. ') 20 | } 21 | 22 | 23 | // var marks = [ 20,100,70] 24 | // console.log(marks) 25 | // tymout(totalMark) 26 | 27 | // function tymout(calls){ 28 | // setTimeout(function(){calls()},5000) 29 | // } 30 | 31 | // function totalMark(){ 32 | // var total = 0; 33 | // marks.forEach(function(sign){ 34 | // total += sign 35 | // }) 36 | // console.log('Student Total Marks.. ' +total) 37 | // }; -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, View } from 'react-native'; 3 | import * as firebase from 'firebase' 4 | import { SignupForm, LoginForm } from './src/components' 5 | 6 | export default class App extends React.Component { 7 | state = { loggedIn: false } 8 | 9 | componentWillMount() { 10 | // Initialize Firebase 11 | var config = { 12 | 13 | }; 14 | firebase.initializeApp(config); 15 | this.checkAuthantication() 16 | } 17 | 18 | checkAuthantication() { 19 | firebase.auth().onAuthStateChanged((user) => { 20 | this.setState({ loggedIn: true }) 21 | }) 22 | this.setState({ loggedIn: false }) 23 | } 24 | 25 | 26 | render() { 27 | return ( 28 | 29 |
30 | 31 | {/**/} 32 | {/*Shake your phone to open the developer menu.*/} 33 | 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/Routes.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Router, Route, IndexRoute, browserHistory } from 'react-router' 3 | 4 | import App from './components/app/App'; 5 | import Login from './components/login/login'; 6 | import SignUp from './components/signup/signup'; 7 | import Home from './components/home'; 8 | 9 | class Routes extends Component { 10 | render() { 11 | return ( 12 | 13 | 14 | 15 | 16 | 17 | 18 | {/**/} 19 | 20 | 21 | 22 | 23 | 24 | ) 25 | } 26 | } 27 | export default Routes; 28 | 29 | {/*npm install react-router@^3.0.2*/ } 30 | {/*npm install packge@version*/ } -------------------------------------------------------------------------------- /Learn server/06/Promices/Practice2/app.js: -------------------------------------------------------------------------------- 1 | 2 | // A promise is an abstraction for asynchronous programming. 3 | // It's an object that proxies for the return value or the 4 | // exception thrown by a function that has to do some 5 | // asynchronous processing 6 | 7 | 8 | // The core idea behind promises is that a promise represents 9 | // the result of an asynchronous operation. A promise is in 10 | // one of three different states: 11 | 12 | // pending - The initial state of a promise. 13 | // fulfilled - The state of a promise representing a successful operation. 14 | // rejected - The state of a promise representing a failed operation. 15 | 16 | var q = require('q'); 17 | workLikeFirebase().then(function () { 18 | console.log("Calling resolve") 19 | }, 20 | // .catch( 21 | function () { 22 | console.log('Calling Reject..') 23 | }) 24 | 25 | function workLikeFirebase() { 26 | var deferred = q.defer(); 27 | 28 | setTimeout(function () { 29 | // deferred.reject() //ERROR 30 | deferred.resolve() // SUCCESS 31 | }, 3000); 32 | 33 | return deferred.promise 34 | } 35 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/components/home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { connect } from 'react-redux' 3 | 4 | // import { Link } from 'react-router' 5 | 6 | 7 | class Home extends Component { 8 | 9 | componentWillMount() { 10 | setTimeout(() => { 11 | console.log(' home page', this.props) 12 | }, 100) 13 | } 14 | 15 | // if (nextProp.isRegistered) { 16 | // browserHistory.push('/home') 17 | // } 18 | 19 | render() { 20 | // console.log(this.props) 21 | return ( 22 |
23 | 24 |

25 | Home page 26 |
27 | {this.props.uesr.name} 28 | {/*home*/} 29 | 30 |

31 |
32 | ) 33 | } 34 | } 35 | 36 | const mapStateToProps = (state) => { 37 | return { 38 | uesr: state.authUser, 39 | isLoggedin: state.isLoggedin 40 | } 41 | } 42 | export default connect(mapStateToProps, null)(Home) 43 | 44 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/LibraryList.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { View, ListView } from 'react-native'; 3 | import { connect } from 'react-redux'; 4 | import ListItem from './ListItem'; 5 | 6 | class LibraryList extends Component { 7 | 8 | componentWillMount() { 9 | const ds = new ListView.DataSource({ 10 | rowHasChanged: (r1, r2) => r1 !== r2 11 | }) 12 | 13 | this.dataSource = ds.cloneWithRows(this.props.libraries); 14 | } 15 | 16 | renderRow(library) { 17 | return ; 18 | } 19 | 20 | render() { 21 | console.log(this.props); 22 | return ( 23 | 27 | ); 28 | } 29 | } 30 | 31 | 32 | const mapStateToProps = state => { 33 | console.log("1", state); 34 | return { 35 | libraries: state.libraries 36 | } 37 | 38 | }; 39 | 40 | export default connect(mapStateToProps)(LibraryList); -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/index.ios.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { AppRegistry, Text, View } from 'react-native'; 3 | import { StackNavigator, TabNavigator } from 'react-navigation' 4 | import { AboutComponent, HomeComponent } from './src' 5 | import { CardSection, Button } from './src/common' 6 | 7 | export default class AwesomeNavigation extends Component { 8 | static navigationOptions = { // for title 9 | title: 'Welcome to Main page', 10 | }; 11 | render() { 12 | const { navigate } = this.props.navigation; 13 | return ( 14 | 15 | Hello, Chat App! 16 | 17 | 20 | 21 | 22 | ); 23 | } 24 | } 25 | 26 | const SimpleApp = StackNavigator({ 27 | Main: { screen: AwesomeNavigation }, 28 | Home: { screen: HomeComponent }, 29 | About: { screen: AboutComponent } 30 | }); 31 | 32 | 33 | AppRegistry.registerComponent('AwesomeNavigation', () => SimpleApp); 34 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/LibraryList.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { View, ListView } from 'react-native'; 3 | import { connect } from 'react-redux'; 4 | import ListItem from './ListItem'; 5 | 6 | class LibraryList extends Component { 7 | 8 | componentWillMount() { 9 | const ds = new ListView.DataSource({ 10 | rowHasChanged: (r1, r2) => r1 !== r2 11 | }) 12 | 13 | this.dataSource = ds.cloneWithRows(this.props.libraries); 14 | } 15 | 16 | renderRow(library) { 17 | return ; 18 | } 19 | 20 | render() { 21 | console.log(this.props); 22 | return ( 23 | 27 | ); 28 | } 29 | } 30 | 31 | 32 | const mapStateToProps = state => { 33 | console.log("1", state); 34 | return { 35 | libraries: state.libraries 36 | } 37 | 38 | }; 39 | 40 | export default connect(mapStateToProps)(LibraryList); -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, TouchableOpacity } from 'react-native'; 3 | 4 | export const Button = ({ onPress, children }) => { 5 | const { buttonStyle, textStyle } = styles; 6 | 7 | return ( 8 | 9 | {children} 10 | 11 | 12 | ) 13 | } 14 | 15 | const styles = { 16 | textStyle: { 17 | alignSelf: 'center', 18 | color: '#007aff', 19 | fontSize: 16, 20 | fontWeight: '600', 21 | paddingTop: 10, 22 | paddingBottom: 10 23 | }, 24 | buttonStyle: { 25 | flex: 1, // I want to this button expand as much as posible in space 26 | alignSelf: 'stretch', // stretch to fill the container 27 | backgroundColor: '#fff', 28 | borderRadius: 5, 29 | borderWidth: 1, 30 | borderColor: '#007aff', 31 | marginLeft: 5, 32 | marginRight: 5 33 | 34 | } 35 | } 36 | 37 | // export { Button: Button }; -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/index.android.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { AppRegistry, Text, View } from 'react-native'; 3 | import { StackNavigator, TabNavigator } from 'react-navigation' 4 | import { AboutComponent, HomeComponent } from './src' 5 | import { CardSection, Button } from './src/common' 6 | 7 | export default class AwesomeNavigation extends Component { 8 | static navigationOptions = { // for title 9 | title: 'Welcome to Main page', 10 | }; 11 | render() { 12 | const { navigate } = this.props.navigation; 13 | return ( 14 | 15 | Hello, Chat App! 16 | 17 | 20 | 21 | 22 | ); 23 | } 24 | } 25 | 26 | const SimpleApp = StackNavigator({ 27 | Main: { screen: AwesomeNavigation }, 28 | Home: { screen: HomeComponent }, 29 | About: { screen: AboutComponent } 30 | }); 31 | 32 | 33 | AppRegistry.registerComponent('AwesomeNavigation', () => SimpleApp); 34 | -------------------------------------------------------------------------------- /Learn server/09/client-side/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import logo from './logo.svg'; 3 | import './App.css'; 4 | import axios from 'axios'; 5 | 6 | class App extends Component { 7 | 8 | 9 | submit() { 10 | var userObj = { 11 | firstName: "Majid", 12 | lastName: "Ashraf", 13 | email: "majid@gmail.com", 14 | password: "mani12", 15 | number: 12345678 16 | } 17 | 18 | return axios.post('http://localhost:3000/CREATEUSER', userObj) 19 | .then((data) => console.log(data)) 20 | .catch((err) => console.log(err)) 21 | } 22 | 23 | 24 | render() { 25 | return ( 26 |
27 |
28 | logo 29 |

Welcome to React

30 |
31 |

32 | To get started, edit src/App.js and save to reload. 33 |

34 | 35 |
36 | ); 37 | } 38 | } 39 | 40 | export default App; 41 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, TouchableOpacity } from 'react-native'; 3 | 4 | export const Button = ({ onPress, children }) => { 5 | const { buttonStyle, textStyle } = styles; 6 | 7 | return ( 8 | 9 | {children} 10 | 11 | 12 | ) 13 | } 14 | 15 | const styles = { 16 | textStyle: { 17 | alignSelf: 'center', 18 | color: '#007aff', 19 | fontSize: 16, 20 | fontWeight: '600', 21 | paddingTop: 10, 22 | paddingBottom: 10 23 | }, 24 | buttonStyle: { 25 | flex: 1, // I want to this button expand as much as posible in space 26 | alignSelf: 'stretch', // stretch to fill the container 27 | backgroundColor: '#fff', 28 | borderRadius: 5, 29 | borderWidth: 1, 30 | borderColor: '#007aff', 31 | marginLeft: 5, 32 | marginRight: 5 33 | 34 | } 35 | } 36 | 37 | // { Button }; 38 | 39 | // export { Button: Button }; -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/store/authReduces/authReducer.js: -------------------------------------------------------------------------------- 1 | import { AuthAction } from '../action/authAction' 2 | 3 | const INITIAL_STATE = { 4 | authUser: {}, 5 | isRegistered: false, 6 | isLoggedin: false, 7 | isLodding: false, 8 | isError: false, 9 | errorMessage: {} 10 | } 11 | 12 | export const AuthReducer = (state = INITIAL_STATE, action) => { 13 | switch (action.type) { 14 | case AuthAction.SIGNUP: 15 | return Object.assign({}, state, { isLodding: true }) 16 | 17 | case AuthAction.SIGNUP_SUCCESS: 18 | return Object.assign({}, state, { isLodding: false, isRegistered: true }) 19 | 20 | case AuthAction.SIGNUP_REJECT: 21 | return Object.assign({}, state, { isLodding: false, errorMessage: action.value, isError: true }) 22 | 23 | case AuthAction.LOGIN_REJECT: 24 | return Object.assign({}, state, { errorMessage: action.value, isError: true }) 25 | case AuthAction.LOGIN: 26 | return Object.assign({}, state, { isLoggedin: true, authUser: action.value }) 27 | default: 28 | return state 29 | } 30 | } -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/components/login/login.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Link } from 'react-router' 3 | 4 | class Login extends Component { 5 | clickMe() { 6 | this.context.router.push({ 7 | pathname: '/home' 8 | }) 9 | } 10 | render() { 11 | return ( 12 |
13 |

14 | Login page 15 |

16 |
17 | 20 | 23 | 24 |
25 | Create a account 26 |
27 | ) 28 | } 29 | } 30 | // Login.contextTypes = { 31 | // router: React.PropTypes.object 32 | // } 33 | export default Login; 34 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | MYAPP_RELEASE_STORE_FILE=my-release-key.keystore 20 | MYAPP_RELEASE_KEY_ALIAS=my-key-alias 21 | MYAPP_RELEASE_STORE_PASSWORD=mani12 22 | MYAPP_RELEASE_KEY_PASSWORD=mani12 23 | android.useDeprecatedNdk=true 24 | -------------------------------------------------------------------------------- /Learn server/07/mongoose basic/app.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | 3 | mongoose.connect('', { 4 | useMongoClient: true 5 | /* other options */ 6 | }); 7 | 8 | 9 | var userSchema = mongoose.Schema({ 10 | name: String, 11 | email: { type: String, required: true, unique: true } 12 | }) 13 | 14 | var userModel = mongoose.model("User", userSchema) 15 | 16 | var users = new userModel({ name: 'Haider', email: "haidere@gmail.com" }); 17 | 18 | users.save(function (err, data) { 19 | if (!err) { 20 | console.log("RESponSE ", data) 21 | } else { 22 | console.log("ERROR", err) 23 | } 24 | }) 25 | 26 | 27 | 28 | 29 | 30 | // When successfully connected 31 | mongoose.connection.on('connected', function () { 32 | console.log('Mongoose default connection open to '); 33 | }); 34 | 35 | // If the connection throws an error 36 | mongoose.connection.on('error', function (err) { 37 | console.log('Mongoose default connection error: ' + err); 38 | }); 39 | 40 | // When the connection is disconnected 41 | mongoose.connection.on('disconnected', function () { 42 | console.log('Mongoose default connection disconnected'); 43 | }); 44 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/java/com/awesomeredux/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.awesomeredux; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | return Arrays.asList( 25 | new MainReactPackage() 26 | ); 27 | } 28 | }; 29 | 30 | @Override 31 | public ReactNativeHost getReactNativeHost() { 32 | return mReactNativeHost; 33 | } 34 | 35 | @Override 36 | public void onCreate() { 37 | super.onCreate(); 38 | SoLoader.init(this, /* native exopackage */ false); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/java/com/awesomenavigation/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.awesomenavigation; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | return Arrays.asList( 25 | new MainReactPackage() 26 | ); 27 | } 28 | }; 29 | 30 | @Override 31 | public ReactNativeHost getReactNativeHost() { 32 | return mReactNativeHost; 33 | } 34 | 35 | @Override 36 | public void onCreate() { 37 | super.onCreate(); 38 | SoLoader.init(this, /* native exopackage */ false); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /12-Mar-17/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | React App 17 | 18 | 19 |
20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /5-Mar-17/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | React App 17 | 18 | 19 |
20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /4-Apr-17-redux lab/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | React App 17 | 18 | 19 |
20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | React App 17 | 18 | 19 |
20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/src/common/Input.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { TextInput, View, Text } from 'react-native'; 3 | 4 | const Input = ({ label, value, onChangeText, placeholder, secureTextEntry }) => { 5 | 6 | const { inputStyle, labelStyle, containerStyle } = styles; 7 | 8 | return ( 9 | 10 | {label} 11 | 20 | 21 | ) 22 | }; 23 | 24 | const styles = { 25 | inputStyle: { 26 | color: '#000', 27 | paddingRight: 5, 28 | paddingLeft: 5, 29 | fontSize: 18, 30 | lineHeight: 23, 31 | flex: 2 32 | }, 33 | labelStyle: { 34 | fontSize: 18, 35 | paddingLeft: 20, 36 | flex: 1 37 | }, 38 | containerStyle: { 39 | height: 40, 40 | flex: 1, 41 | flexDirection: 'row', 42 | alignItems: 'center' 43 | } 44 | } 45 | 46 | export { Input }; -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | React App 17 | 18 | 19 |
20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/common/Input.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { TextInput, View, Text } from 'react-native'; 3 | 4 | export const Input = ({ label, value, onChangeText, placeholder, secureTextEntry }) => { 5 | 6 | const { inputStyle, labelStyle, containerStyle } = styles; 7 | 8 | return ( 9 | 10 | {label} 11 | 20 | 21 | ) 22 | }; 23 | 24 | const styles = { 25 | inputStyle: { 26 | color: '#000', 27 | paddingRight: 5, 28 | paddingLeft: 5, 29 | fontSize: 18, 30 | lineHeight: 23, 31 | flex: 2 32 | }, 33 | labelStyle: { 34 | fontSize: 18, 35 | paddingLeft: 20, 36 | flex: 1 37 | }, 38 | containerStyle: { 39 | height: 40, 40 | flex: 1, 41 | flexDirection: 'row', 42 | alignItems: 'center' 43 | } 44 | } 45 | 46 | // export { Input }; -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | React App 17 | 18 | 19 |
20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/src/components/common/Input.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { TextInput, Text, View } from 'react-native' 3 | 4 | export const Input = ({ label, value, onChangeText, placeholder, secureTextEntry }) => { 5 | const { containerStyle, inputStyle, labelStyle } = styles 6 | return ( 7 | 8 | {label} 9 | 18 | 19 | ) 20 | } 21 | 22 | const styles = { 23 | inputStyle: { 24 | color: '#000', 25 | paddingRight: 5, 26 | paddingLeft: 5, 27 | fontSize: 18, 28 | lineHeight: 23, 29 | flex: 2 30 | }, 31 | labelStyle: { 32 | fontSize: 18, 33 | paddingLeft: 20, 34 | flex: 1 35 | }, 36 | containerStyle: { 37 | height: 40, 38 | flex: 1, 39 | flexDirection: 'row', 40 | // align: 'center' 41 | } 42 | } -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/java/com/capturepicture/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.capturepicture; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.lwansbrough.RCTCamera.RCTCameraPackage; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.shell.MainReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage(), 27 | new RCTCameraPackage() 28 | ); 29 | } 30 | }; 31 | 32 | @Override 33 | public ReactNativeHost getReactNativeHost() { 34 | return mReactNativeHost; 35 | } 36 | 37 | @Override 38 | public void onCreate() { 39 | super.onCreate(); 40 | SoLoader.init(this, /* native exopackage */ false); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Learn server/03/Middleware/basic samples/route-example.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var path = require("path"); 3 | var http = require("http"); 4 | var logger = require("morgan"); 5 | var app = express(); 6 | 7 | app.use(logger("short")); 8 | 9 | app.get("/", function (request, response) { 10 | response.end("Welcome to my homepage!"); 11 | }); 12 | 13 | app.get("/about", function (request, response) { 14 | response.end("Welcome to the about page!"); 15 | }); 16 | 17 | app.get("/weather", function (request, response) { 18 | response.end("The current weather is NICE."); 19 | }); 20 | 21 | app.get("/hello/:who", function (request, response) { 22 | response.end("Hello, " + request.params.who + "."); 23 | // Fun fact: this has some security issues, which we’ll get to! 24 | }); 25 | 26 | app.get("/redirect_anyWhere", function (request, response) { 27 | response.redirect("https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/tree/master/Learn%20server"); 28 | }); 29 | 30 | app.get("/sendfile", function (request, response) { 31 | var filePath = path.resolve(__dirname, "exm/index.html"); 32 | response.sendFile(filePath); 33 | }); 34 | app.use(function (request, response) { 35 | response.statusCode = 404; 36 | response.end("404!"); 37 | }); 38 | http.createServer(app).listen(3000); 39 | -------------------------------------------------------------------------------- /Learn server/04/Middleware/basic samples/route-example.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var path = require("path"); 3 | var http = require("http"); 4 | var logger = require("morgan"); 5 | var app = express(); 6 | 7 | app.use(logger("short")); 8 | 9 | app.get("/", function (request, response) { 10 | response.end("Welcome to my homepage!"); 11 | }); 12 | 13 | app.get("/about", function (request, response) { 14 | response.end("Welcome to the about page!"); 15 | }); 16 | 17 | app.get("/weather", function (request, response) { 18 | response.end("The current weather is NICE."); 19 | }); 20 | 21 | app.get("/hello/:who", function (request, response) { 22 | response.end("Hello, " + request.params.who + "."); 23 | // Fun fact: this has some security issues, which we’ll get to! 24 | }); 25 | 26 | app.get("/redirect_anyWhere", function (request, response) { 27 | response.redirect("https://github.com/Abdul-majid-ashrafi/Saylani_theory_batch4/tree/master/Learn%20server"); 28 | }); 29 | 30 | app.get("/sendfile", function (request, response) { 31 | var filePath = path.resolve(__dirname, "exm/index.html"); 32 | response.sendFile(filePath); 33 | }); 34 | app.use(function (request, response) { 35 | response.statusCode = 404; 36 | response.end("404!"); 37 | }); 38 | http.createServer(app).listen(3000); 39 | -------------------------------------------------------------------------------- /Learn server/05/Create GuesstBook/app.js: -------------------------------------------------------------------------------- 1 | /* global __dirname */ 2 | var http = require("http"); 3 | var path = require("path"); 4 | var express = require("express"); 5 | var app = express(); 6 | var bodyParser = require("body-parser"); 7 | 8 | app.use(bodyParser.json(), function (err, req, res, next) { 9 | if (err) { 10 | return res.status(500).json({ error: err }); 11 | } 12 | next(); 13 | }); 14 | app.use(bodyParser.urlencoded({ extended: false })); 15 | 16 | 17 | 18 | app.set("views", path.resolve(__dirname, "views")); 19 | app.set("view engine", "ejs"); 20 | var array = []; 21 | app.locals.entries = array; 22 | 23 | 24 | 25 | app.get("/", function (request, response) { 26 | response.render("index"); 27 | }); 28 | app.get("/new-entry", function (request, response) { 29 | response.render("new-entry"); 30 | }); 31 | app.get('/rest', function (request, response) { 32 | array = [] 33 | 34 | }) 35 | app.post("/new-entry", function (request, response) { 36 | array.push({ 37 | title: request.body.title, 38 | content: request.body.content, 39 | published: new Date() 40 | }); 41 | response.redirect("/"); 42 | }); 43 | app.use(function (request, response) { 44 | response.status(404).render("404"); 45 | }); 46 | http.createServer(app).listen(3000, function () { 47 | console.log("Guestbook app started on port 3000."); 48 | }); -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | export default class capturePicture extends Component { 16 | render() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.ios.js 24 | 25 | 26 | Press Cmd+R to reload,{'\n'} 27 | Cmd+D or shake for dev menu 28 | 29 | 30 | ); 31 | } 32 | } 33 | 34 | const styles = StyleSheet.create({ 35 | container: { 36 | flex: 1, 37 | justifyContent: 'center', 38 | alignItems: 'center', 39 | backgroundColor: '#F5FCFF', 40 | }, 41 | welcome: { 42 | fontSize: 20, 43 | textAlign: 'center', 44 | margin: 10, 45 | }, 46 | instructions: { 47 | textAlign: 'center', 48 | color: '#333333', 49 | marginBottom: 5, 50 | }, 51 | }); 52 | 53 | AppRegistry.registerComponent('capturePicture', () => capturePicture); 54 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/store/action/authAction.js: -------------------------------------------------------------------------------- 1 | export class AuthAction { 2 | static SIGNUP = "SIGNUP" 3 | static LOGIN = "LOGIN" 4 | static LOGOUT = "LOGOUT" 5 | static SIGNUP_SUCCESS = "SIGNUP_SUCCESS" 6 | 7 | static LOGOUT_REJECT = "LOGOUT_REJECT" 8 | static SIGNUP_REJECT = "SIGNUP_REJECT" 9 | static LOGIN_REJECT = "LOGIN_REJECT" 10 | 11 | 12 | static signupProsess() { 13 | return { 14 | type: AuthAction.SIGNUP 15 | } 16 | } 17 | static signupSuccessFull() { 18 | return { 19 | type: AuthAction.SIGNUP_SUCCESS 20 | } 21 | } 22 | 23 | static signupReject(reason) { 24 | return { 25 | type: AuthAction.SIGNUP_REJECT, 26 | value: reason 27 | } 28 | } 29 | 30 | static loginSuccessFull(authUser) { 31 | return { 32 | type: AuthAction.LOGIN, 33 | value: authUser 34 | } 35 | } 36 | 37 | static loginReject(reason) { 38 | return { 39 | type: AuthAction.SIGNUP_REJECT, 40 | value: reason 41 | } 42 | } 43 | 44 | 45 | static logOutUser() { 46 | return { 47 | type: AuthAction.LOGOUT 48 | } 49 | } 50 | 51 | static logOutUserReject(reason) { 52 | return { 53 | type: AuthAction.LOGOUT_REJECT, 54 | value: reason 55 | } 56 | } 57 | 58 | 59 | } -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeRedux/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"AwesomeRedux" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePicture/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"capturePicture" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigation/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"AwesomeNavigation" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | emoji=true 26 | 27 | module.system=haste 28 | 29 | experimental.strict_type_args=true 30 | 31 | munge_underscores=true 32 | 33 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 34 | 35 | suppress_type=$FlowIssue 36 | suppress_type=$FlowFixMe 37 | suppress_type=$FixMe 38 | 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 41 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 42 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 43 | 44 | unsafe.enable_getters_and_setters=true 45 | 46 | [version] 47 | ^0.42.0 48 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | emoji=true 26 | 27 | module.system=haste 28 | 29 | experimental.strict_type_args=true 30 | 31 | munge_underscores=true 32 | 33 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 34 | 35 | suppress_type=$FlowIssue 36 | suppress_type=$FlowFixMe 37 | suppress_type=$FixMe 38 | 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 41 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 42 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 43 | 44 | unsafe.enable_getters_and_setters=true 45 | 46 | [version] 47 | ^0.42.0 48 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | emoji=true 26 | 27 | module.system=haste 28 | 29 | experimental.strict_type_args=true 30 | 31 | munge_underscores=true 32 | 33 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 34 | 35 | suppress_type=$FlowIssue 36 | suppress_type=$FlowFixMe 37 | suppress_type=$FixMe 38 | 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 41 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 42 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 43 | 44 | unsafe.enable_getters_and_setters=true 45 | 46 | [version] 47 | ^0.42.0 48 | -------------------------------------------------------------------------------- /Learn server/02/Saturday/app.js: -------------------------------------------------------------------------------- 1 | var express = require('express') // Import express module from node_modules 2 | var http = require('http') // Import http module from node_modules 3 | var app = express() // call express function which means return req.handlerFunction 4 | 5 | // app.get('/', (request, response) => { 6 | // response.send("helle world") 7 | // }) 8 | // app.get('/home', (request, response) => { 9 | // response.send("Render home page") 10 | // }) 11 | 12 | 13 | // app.use(function (request, response, next) { 14 | // // response.writeHead(200, { "Content-Type": "text/plain" }); 15 | // // response.end("Hello, World!"); 16 | // console.log("run middleware") 17 | // next() 18 | // }) 19 | 20 | // app.use(function (request, response,next) { 21 | // // response.writeHead(200, { "Content-Type": "text/plain" }); 22 | // // response.end("Hello, World!"); 23 | // console.log("run middleware2121121") 24 | // next() 25 | // }) 26 | 27 | // app.get('/', (request, response) => { 28 | // response.send("helle world") 29 | // }) 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | app.use((request, response, next) => { 39 | console.log("Logging done") 40 | next() 41 | }) 42 | app.use((request, response, next) => { 43 | var minuts = (new Date()).getMinutes() 44 | if ((minuts % 2) === 0) { 45 | next() 46 | } else { 47 | response.send("User Not Authorized") 48 | } 49 | }) 50 | 51 | app.use((request, response) => { 52 | response.send("Auth Success Send Informission") 53 | }) 54 | 55 | 56 | 57 | 58 | 59 | 60 | http.createServer(app).listen(3000); 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Learn server/04/Template/body_parser.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var bodyParser = require('body-parser'); 3 | 4 | 5 | var app = express(); 6 | 7 | // instruct the app to use the `bodyParser()` 8 | //middleware for all routes 9 | app.use(bodyParser.json()); 10 | // app.use(bodyParser.urlencoded({ extended: false })); 11 | 12 | // A browser's default method is 'GET', so this 13 | // is the route that express uses when we visit 14 | // our site initially. 15 | app.get('/', function (req, res) { 16 | // The form's action is '/' and its method is 'POST', 17 | // so the `app.post('/', ...` route will receive the 18 | // result of our form 19 | var html = '
' + 20 | 'Enter your name:' + 21 | '' + 22 | '
' + '
' + 23 | 'Enter Your Age:' + 24 | '' + 25 | '
' + 26 | '' + 27 | '
'; 28 | 29 | res.send(html); 30 | }); 31 | 32 | // This route receives the posted form. 33 | // As explained above, usage of 'body-parser' means 34 | // that `req.body` will be filled in with the form elements 35 | app.post('/result', function (req, res) { 36 | console.log(req.body) 37 | var myName = req.body.userName; 38 | var myAge = req.body.age; 39 | var htmlName = 40 | 'Hello: ' + myName + '.
' + 41 | '
' + 'Your Age Is: ' + myAge + '
' + 42 | '.
' + 'Try again.'; 43 | res.send(htmlName); 44 | }); 45 | 46 | // app.post('/todo', function (request, response) { 47 | // console.log(request.body) 48 | // response.send(request.body.name) 49 | // }) 50 | 51 | 52 | app.listen(3000); -------------------------------------------------------------------------------- /Learn server/09/client-side/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 22 | React App 23 | 24 | 25 | 28 |
29 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/index.android.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | AppRegistry, 4 | StyleSheet, 5 | Dimensions, 6 | Text, 7 | View 8 | } from 'react-native'; 9 | import Camera from 'react-native-camera'; 10 | 11 | 12 | export default class capturePicture extends Component { 13 | takePicture() { 14 | this.camera.capture() 15 | .then((data) => console.log(data)) 16 | .catch(err => console.error(err)); 17 | } 18 | render() { 19 | return ( 20 | { 22 | console.log('cam', cam) 23 | this.camera = cam; 24 | }} 25 | style={styles.preview} 26 | aspect={Camera.constants.Aspect.fill} 27 | > 28 | capture 29 | 30 | ); 31 | } 32 | } 33 | 34 | const styles = StyleSheet.create({ 35 | preview: { 36 | flex: 1, 37 | justifyContent: 'flex-end', 38 | alignItems: 'center', 39 | height: Dimensions.get('window').height, 40 | width: Dimensions.get('window').width 41 | }, 42 | capture: { 43 | flex: 0, 44 | backgroundColor: '#fff', 45 | borderRadius: 5, 46 | color: '#000', 47 | padding: 10, 48 | margin: 40 49 | } 50 | }); 51 | 52 | AppRegistry.registerComponent('capturePicture', () => capturePicture); 53 | /* 54 | 55 | Welcome to React Native! 56 | 57 | 58 | To get started, edit index.android.js 59 | 60 | 61 | Double tap R on your keyboard to reload,{'\n'} 62 | Shake or press menu button for dev menu 63 | 64 | */ 65 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePicture-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeRedux-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigation-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.awesomeredux", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.awesomeredux", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /2-Apr-17 = redux+authFirebase/src/components/login/login.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Link, browserHistory } from 'react-router' 3 | import { connect } from 'react-redux' 4 | import { FirebaseAuthService } from '../../store/middleware/auth' 5 | 6 | class Login extends Component { 7 | 8 | 9 | componentWillReceiveProps(nextProp) { 10 | if (nextProp.isLoggedin) { 11 | browserHistory.push('/home') 12 | } 13 | } 14 | 15 | loginUser(ev) { 16 | ev.preventDefault() 17 | let user = { 18 | email: this.refs.email.value, 19 | pass: this.refs.pass.value, 20 | } 21 | this.props.loginWithFirebase(user) 22 | } 23 | 24 | 25 | render() { 26 | return ( 27 |
28 |

29 | Login page 30 |

31 |
32 | 35 | 38 | 39 |
40 | Create a account 41 |
42 | ) 43 | } 44 | } 45 | 46 | const mapStateToProps = (state) => { 47 | return { 48 | isLoggedin: state.isLoggedin 49 | } 50 | } 51 | 52 | const mapDispatchToProps = (dispatch) => { 53 | return { 54 | loginWithFirebase: (user) => { 55 | dispatch(FirebaseAuthService.loginOnFirebase(user)) 56 | } 57 | } 58 | } 59 | export default connect(mapStateToProps, mapDispatchToProps)(Login) 60 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.capturepicture", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.capturepicture", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.awesomenavigation", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.awesomenavigation", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /26-Mar-17 = routing+firebaseAuthantication/src/components/signup/signup.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Link } from 'react-router' 3 | import firebase from 'firebase' 4 | 5 | 6 | class Signup extends Component { 7 | // clickMe() { 8 | // this.context.router.push({ 9 | // pathname: '/home' 10 | // }) 11 | // } 12 | 13 | createUser(ev) { 14 | ev.preventDefault() 15 | let user = { 16 | email: this.refs.email.value, 17 | pass: this.refs.pass.value, 18 | name: this.refs.name.value 19 | } 20 | 21 | firebase.auth().createUserWithEmailAndPassword(user.email, user.pass) 22 | .then((user) => { 23 | console.log(user) 24 | }) 25 | .catch((error) => { 26 | console.log(error.message) 27 | }); 28 | } 29 | render() { 30 | return ( 31 |
32 |

33 | Signup page 34 |

35 | Login 36 |
37 | 40 | 43 | 46 | 47 | 48 |
49 |
50 | ) 51 | } 52 | } 53 | Signup.contextTypes = { 54 | router: React.PropTypes.object 55 | } 56 | export default Signup; 57 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/ios/AwesomeRedux/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | AwesomeRedux 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /React Native/AwesomeCamera/ios/capturePicture/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | capturePicture 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /React Native/AwesomeNavigation/ios/AwesomeNavigation/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | AwesomeNavigation 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet, Text, View, Image ,TouchableOpacity,ActivityIndicator} from 'react-native'; 3 | 4 | import { HomeComponent } from './src/components/Home' 5 | 6 | export default class App extends Component { 7 | constructor(props){ 8 | super(props) 9 | this.state = { 10 | increment:0 11 | } 12 | } 13 | increment(){ 14 | this.setState({ 15 | increment:this.state.increment + 1 16 | },()=>{ 17 | console.log(this.state.increment) 18 | }) 19 | } 20 | reset(){ 21 | this.setState({ 22 | increment:0 23 | },()=>{ 24 | console.log(this.state.increment) 25 | }) 26 | } 27 | render() { 28 | return ( 29 | 30 | 31 | Click Me 32 | 33 | 34 | Reset 35 | 36 | 37 | {this.state.increment} 38 | 39 | ); 40 | } 41 | } 42 | 43 | 44 | 45 | const styles = StyleSheet.create({ 46 | container: { 47 | flex: 1, 48 | backgroundColor: '#fff', 49 | alignItems: 'center', 50 | justifyContent: 'center', 51 | }, 52 | textStyle: { 53 | fontSize: 33, 54 | color:'red' 55 | } 56 | }); 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | /*import React, { Component } from 'react'; 76 | import { StyleSheet, Text, View, Image } from 'react-native'; 77 | import { Header, List } from './scr/tags' 78 | // import { FormLabel, FormInput, Button } from 'react-native-elements' 79 | 80 | export default class App extends Component { 81 | render() { 82 | return ( 83 | 84 |
85 | 86 | 87 | ); 88 | } 89 | }*/ 90 | 91 | -------------------------------------------------------------------------------- /React Native/AwesomeRedux/src/component/loginForm.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { View, Text } from 'react-native' 3 | import { connect } from 'react-redux' 4 | import { emailChanged, passwordChange } from '../action/authAction' 5 | import { Button, Card, CardSection, Input, Spinner } from '../common' 6 | 7 | class LoginForm extends Component { 8 | 9 | login() { 10 | alert('hello') 11 | } 12 | onChangeEmail(text) { 13 | this.props.changeEmailDispatch(text) 14 | } 15 | 16 | render() { 17 | console.log('this.props', this.props) 18 | 19 | return ( 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | ) 48 | } 49 | } 50 | 51 | const mapStateToProps = (state) => { 52 | return { 53 | mail: state.authanticationReducer.email 54 | // pass: state.authanticationReducer.password 55 | } 56 | } 57 | 58 | const mapDispatchToProps = (dispatch) => { 59 | return { 60 | changeEmailDispatch: (email) => { 61 | dispatch(emailChanged(email)) 62 | } 63 | } 64 | } 65 | 66 | export default connect(mapStateToProps, mapDispatchToProps)(LoginForm) 67 | -------------------------------------------------------------------------------- /18-Mar-17 - todo-firebase/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import logo from './logo.svg'; 3 | import './App.css'; 4 | import firebase from 'firebase' 5 | 6 | class App extends Component { 7 | constructor(props) { 8 | super(props) 9 | this.addTodo = this.addTodo.bind(this) 10 | this.state = { 11 | todos: [] 12 | } 13 | } 14 | 15 | componentWillMount() { 16 | let refRoot = firebase.database().ref('/todo/') 17 | refRoot.on("child_added", (snap) => { 18 | var obj = snap.val(); 19 | obj.id = snap.key 20 | this.state.todos.push(obj) 21 | this.setState({ todos: this.state.todos }) 22 | }) 23 | } 24 | 25 | addTodo(ev) { 26 | ev.preventDefault() 27 | let refRoot = firebase.database().ref('/todo/') 28 | refRoot.push({ todo: this.refs.todo.value }) 29 | } 30 | 31 | itemRemove(val) { 32 | let refRoot = firebase.database().ref(`/todo/${val.id}`) 33 | refRoot.remove().then((i) => { 34 | 35 | let allTodos = this.state.todos; 36 | let removeIndex; 37 | for (var i = 0; i < allTodos.length; i++) { 38 | if (allTodos[i].id === val.id) { 39 | removeIndex = i 40 | } 41 | } 42 | allTodos = allTodos.slice(0, removeIndex).concat(allTodos.slice(removeIndex + 1)) 43 | this.setState({ todos: allTodos }) 44 | // console.log(allTodos) 45 | }) 46 | } 47 | 48 | 49 | render() { 50 | return ( 51 |
52 | logo 53 |

Welcome to React Todo

54 | 55 |
56 | 57 | 58 |
59 | {this.state.todos.map((value, index) => { 60 | return ( 61 |

62 | {value.todo} 63 | 65 |

66 | ) 67 | })} 68 |
69 | ); 70 | } 71 | } 72 | 73 | export default App; 74 | -------------------------------------------------------------------------------- /React Native EXPO/firebase-Authantication/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | ; Additional create-react-native-app ignores 18 | 19 | ; Ignore duplicate module providers 20 | .*/node_modules/fbemitter/lib/* 21 | 22 | ; Ignore misbehaving dev-dependencies 23 | .*/node_modules/xdl/build/* 24 | .*/node_modules/reqwest/tests/* 25 | 26 | ; Ignore missing expo-sdk dependencies (temporarily) 27 | ; https://github.com/exponent/exponent-sdk/issues/36 28 | .*/node_modules/expo/src/* 29 | 30 | ; Ignore react-native-fbads dependency of the expo sdk 31 | .*/node_modules/react-native-fbads/* 32 | 33 | [include] 34 | 35 | [libs] 36 | node_modules/react-native/Libraries/react-native/react-native-interface.js 37 | node_modules/react-native/flow 38 | flow/ 39 | 40 | [options] 41 | module.system=haste 42 | 43 | emoji=true 44 | 45 | experimental.strict_type_args=true 46 | 47 | munge_underscores=true 48 | 49 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 50 | 51 | suppress_type=$FlowIssue 52 | suppress_type=$FlowFixMe 53 | suppress_type=$FixMe 54 | 55 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 56 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 57 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 58 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 59 | 60 | unsafe.enable_getters_and_setters=true 61 | 62 | [version] 63 | ^0.40.0 64 | -------------------------------------------------------------------------------- /React Native EXPO/my-application-naitive/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | ; Additional create-react-native-app ignores 18 | 19 | ; Ignore duplicate module providers 20 | .*/node_modules/fbemitter/lib/* 21 | 22 | ; Ignore misbehaving dev-dependencies 23 | .*/node_modules/xdl/build/* 24 | .*/node_modules/reqwest/tests/* 25 | 26 | ; Ignore missing expo-sdk dependencies (temporarily) 27 | ; https://github.com/exponent/exponent-sdk/issues/36 28 | .*/node_modules/expo/src/* 29 | 30 | ; Ignore react-native-fbads dependency of the expo sdk 31 | .*/node_modules/react-native-fbads/* 32 | 33 | [include] 34 | 35 | [libs] 36 | node_modules/react-native/Libraries/react-native/react-native-interface.js 37 | node_modules/react-native/flow 38 | flow/ 39 | 40 | [options] 41 | module.system=haste 42 | 43 | emoji=true 44 | 45 | experimental.strict_type_args=true 46 | 47 | munge_underscores=true 48 | 49 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 50 | 51 | suppress_type=$FlowIssue 52 | suppress_type=$FlowFixMe 53 | suppress_type=$FixMe 54 | 55 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 56 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 57 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 58 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 59 | 60 | unsafe.enable_getters_and_setters=true 61 | 62 | [version] 63 | ^0.40.0 64 | --------------------------------------------------------------------------------