Skip to content

Instantly share code, notes, and snippets.

View sidthesloth92's full-sized avatar

Dinesh Balaji sidthesloth92

View GitHub Profile
gulp.task('default', function() {
console.log("hello, world");
});
@sidthesloth92
sidthesloth92 / 0_reuse_code.js
Created April 1, 2016 03:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sidthesloth92
sidthesloth92 / package.json
Last active May 15, 2016 18:02
Angular 2 – Hello World App – Typescript
{
"name": "angular2-helloworld",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
{
"ambientDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';
bootstrap(AppComponent);
import { bootstrap } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app.component';
bootstrap(AppComponent);
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>Hello, World!!!</h1>'
})
export class AppComponent {}
<html>
<head>
<title>Angular 2 Hello World</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 1. Load libraries -->
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
yourModule.controller('FileController', function($scope, $cordovaCamera, $cordovaFile) {
$scope.fileName = "";
$scope.uploadPicture = function() {
var options = {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 1024,