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
| // Listen for orientation changes | |
| window.addEventListener("orientationchange", function() { | |
| // Announce the new orientation number | |
| alert(window.orientation); | |
| }, false); | |
| // Listen for resize changes | |
| window.addEventListener("resize", function() { | |
| // Get screen size (inner/outerWidth, inner/outerHeight) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Pipe } from 'angular2/core.js'; | |
| /** | |
| * Map to Iteratble Pipe | |
| * | |
| * It accepts Objects and [Maps](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) | |
| * | |
| * Example: | |
| * | |
| * <div *ngFor="#keyValuePair of someObject | mapToIterable"> |
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
| window.router = new VueRouter({ | |
| hashbang: false, | |
| //abstract: true, | |
| history: true, | |
| mode: 'html5', | |
| linkActiveClass: 'active', | |
| transitionOnLoad: true, | |
| root: '/' | |
| }); | |
| and server is properly configured In apache you should write the url rewrite |
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
| // Fix Vendor Prefixes | |
| var IS_CHROME = !!window.webkitRTCPeerConnection, | |
| RTCPeerConnection, | |
| RTCIceCandidate, | |
| RTCSessionDescription; | |
| if (IS_CHROME) { | |
| RTCPeerConnection = webkitRTCPeerConnection; | |
| RTCIceCandidate = window.RTCIceCandidate; | |
| RTCSessionDescription = window.RTCSessionDescription; |
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
| to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice | |
| stun: | |
| stun.l.google.com:19302, | |
| stun1.l.google.com:19302, | |
| stun2.l.google.com:19302, | |
| stun3.l.google.com:19302, | |
| stun4.l.google.com:19302, | |
| stun.ekiga.net, | |
| stun.ideasip.com, |
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
| # source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
| # A list of available STUN server. | |
| stun.l.google.com:19302 | |
| stun1.l.google.com:19302 | |
| stun2.l.google.com:19302 | |
| stun3.l.google.com:19302 | |
| stun4.l.google.com:19302 | |
| stun01.sipphone.com | |
| stun.ekiga.net |
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
| # BEGIN POWERED CACHE | |
| <IfModule mod_mime.c> | |
| AddType image/jpeg .jpg .jpeg .jpe | |
| AddType image/gif .gif | |
| AddType image/png .png | |
| AddType image/bmp .bmp | |
| AddType image/tiff .tiff .tif | |
| AddType image/x-icon .ico | |
| AddType video/x-ms-asf .asf .asx | |
| AddType video/x-ms-wmv .wmv |
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
| function mime2ext($mime){ | |
| $all_mimes = '{"png":["image\/png","image\/x-png"],"bmp":["image\/bmp","image\/x-bmp","image\/x-bitmap","image\/x-xbitmap","image\/x-win-bitmap","image\/x-windows-bmp","image\/ms-bmp","image\/x-ms-bmp","application\/bmp","application\/x-bmp","application\/x-win-bitmap"],"gif":["image\/gif"],"jpeg":["image\/jpeg","image\/pjpeg"],"xspf":["application\/xspf+xml"],"vlc":["application\/videolan"],"wmv":["video\/x-ms-wmv","video\/x-ms-asf"],"au":["audio\/x-au"],"ac3":["audio\/ac3"],"flac":["audio\/x-flac"],"ogg":["audio\/ogg","video\/ogg","application\/ogg"],"kmz":["application\/vnd.google-earth.kmz"],"kml":["application\/vnd.google-earth.kml+xml"],"rtx":["text\/richtext"],"rtf":["text\/rtf"],"jar":["application\/java-archive","application\/x-java-application","application\/x-jar"],"zip":["application\/x-zip","application\/zip","application\/x-zip-compressed","application\/s-compressed","multipart\/x-zip"],"7zip":["application\/x-compressed"],"xml":["application\/xml","text\/xml"],"svg": |
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
| function getExtension ($mime_type){ | |
| $extensions = return array( | |
| 'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'), | |
| 'cpt' => 'application/mac-compactpro', | |
| 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'), | |
| 'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'), | |
| 'dms' => 'application/octet-stream', | |
| 'lha' => 'application/octet-stream', | |
| 'lzh' => 'application/octet-stream', |
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 { createStore, applyMiddleware } = require('redux'); | |
| const initUser = { name: "", age: 0 }; | |
| const userReducer = (state = initUser, action) => { | |
| switch (action.type) { | |
| case "UPDATE_NAME": | |
| state = { ...state, name: action.payload }; | |
| return state; | |
| case "UPDATE_AGE": | |
| state = { ...state, age: action.payload }; |