This file contains 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 EventEmitter = require('events').EventEmitter; | |
var doSomething = function () { | |
var result = new EventEmitter(); | |
setTimeout(function () { | |
result.emit('success', 'Hello World!'); | |
}, 1000); | |
return result; | |
}; |
This file contains 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 rest = require('restler'); | |
var FileInfo = require('./FileInfo.js'); | |
var file = new FileInfo([FULL PATH OF YOUR FILE]); | |
rest.post([API_ULR], { | |
multipart: true, | |
data: { | |
file: rest.file(file.fullPath, file.name, file.size, null, file.contentType) | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = require('path'); | |
var mime = require('mime'); | |
var FileInfo = function (fullPath) { | |
if (fs.existsSync(fullPath)) { | |
this.fullPath = fullPath; | |
var stats = fs.statSync(fullPath); | |
this.size = stats["size"]; | |
this.name = path.basename(fullPath); |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Net; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.WindowsAzure.Diagnostics; | |
using Microsoft.WindowsAzure.ServiceRuntime; | |
using Microsoft.WindowsAzure.Storage; |
This file contains 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
# view log | |
$ sudo grep cron /var/log/syslog | |
# restart | |
$ sudo service cron restart | |
# edit crontab | |
$ crontab -e | |
# list crontab |
This file contains 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
public static function TicksToTime($tick){ | |
return floor(($ticks - 621355968000000000) / 10000000); | |
} | |
public static function TimeToTicks($time){ | |
return number_format(($time * 10000000) + 621355968000000000 , 0, ’.’, “); |
This file contains 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
using Microsoft.Media.AdaptiveStreaming; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.InteropServices.WindowsRuntime; | |
using Windows.Foundation; | |
using Windows.Foundation.Collections; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; |
This file contains 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
<Page | |
x:Class="SmoothStreamingWP81.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:SmoothStreamingWP81" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" | |
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"> | |
.... | |
<Extensions> | |
<Extension Category="windows.activatableClass.inProcessServer"> | |
<InProcessServer> |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |