This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var browserSync = require('browser-sync'); | |
| gulp.task('browser-sync', function() { | |
| browserSync.init(['./*.html'], { | |
| server: { | |
| baseDir: "./" | |
| } | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $scope.$watch('color', function(newValue, oldValue) { | |
| $scope.previousColor = oldValue; | |
| }); | |
| $scope.changeColor = function(){ | |
| $http.put('...', {color: $scope.color}).error(function(){ | |
| $scope.color = $scope.previousColor; | |
| }); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html ng-app="ionicApp"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
| <title>ionic collection-repeat with variable height example</title> | |
| <script src="http://code.ionicframework.com/1.0.0-rc.1/js/ionic.bundle.js"> | |
| </script> | |
| <style> | |
| .my-item > div { | |
| border-style: solid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div ng-app="App"> | |
| <div ng-controller="MyCtrl"> | |
| <div class="tags"> | |
| <ul class="list-inline"> | |
| <li ng-repeat="item in items track by $index"> | |
| {{item}} <button ng-click="remove($index)">X</button> | |
| </li> | |
| <li style="position:absolute;"> | |
| <input class="silent" ng-model="keyword" ng-keypress="key($event)"> | |
| <ul ng-show="keyword"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company; | |
| import javax.net.ssl.SSLSocket; | |
| import javax.net.ssl.SSLSocketFactory; | |
| import java.io.*; | |
| /** | |
| * java | |
| * -Djavax.net.ssl.trustStore=sslkeystore | |
| * -Djavax.net.ssl.trustStorePassword=123456 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by Chun on 8/18/2015. | |
| */ | |
| (function (win) { | |
| var global = win; | |
| var doc = this.document; | |
| var dom = function(params, context) { | |
| return new GetOrMakeDom(params, context); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##Define | |
| scope | |
| ##Examples | |
| private variables | |
| -- | |
| object oriented | |
| -- | |
| function Ninja() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Controller | |
| public class FileController { | |
| @RequestMapping(value = "upload", method = RequestMethod.POST) | |
| @ResponseBody | |
| public String uploadFile(@RequestBody Map<String, String> file) throws IOException { | |
| System.out.println(file.get("name")); | |
| System.out.println(file.get("content")); | |
| byte[] fileContent = Base64.decodeBase64(file.get("content").split(",")[1]); | |
| Files.write(fileContent, new File("/Users/ringoluo/Desktop/" + file.get("name"))); | |
| return "ok"; |