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
function uuidv4() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} | |
const countries = ["Singapore", "Malaysia", "Japan", "Korea", "USA", "UK", "Australia"]; | |
function randomCountry(){ | |
return countries[Math.floor(Math.random() * countries.length)] |
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
// Shinobi (http://shinobi.video) - FFMPEG H.264 over HTTP Test | |
// How to Use raw H.264 (Simulated RTSP) | |
// 1. Start with `node ffmpegToWeb.js` | |
// 2. Get the IP address of the computer where you did step 1. Example : 127.0.0.1 | |
// 3. Open VLC and "Open Network Stream". | |
// 4. Input the following without quotes : `http://127.0.0.1:8001/h264` and start. | |
var child = require('child_process'); | |
var io = require('socket.io'); | |
var events = require('events'); |
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
btn Button chk CheckBox ckl CheckedListBox | |
cmb ComboBox dtp DateTimePicker lbl Label | |
llb LinkLabel lst ListBox lvw ListView | |
mtx MaskedTextBox cdr MonthCalendar icn NotifyIcon | |
nud NumeircUpDown pic PictureBox prg ProgressBar | |
rdo RadioButton rtx RichTextBox txt TextBox | |
tip ToolTip tvw TreeView wbs WebBrowser | |
?? | |
flp FlowLayoutPanel grp GroupBox pnl Panel |
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 class Extensions { | |
public static Dictionary<int, IEnumerable<T>> AdjustablePartition<T>(this IEnumerable<T> source, int count) { | |
var map = new Dictionary<int, IEnumerable<T>>(); | |
var average = (int)Math.Round(source.Count() / (double)count); | |
for (int i = 0; i < count; i++) { | |
if (i == count - 1) { | |
var skipCount = (i) * average; | |
var takeCount = source.Count() - skipCount; |
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 mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
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
//"avcoti" hexadecimal representation of the following three bytes in the (subset) sequence parameter set Network Abstraction Layer (NAL) unit specified in AVC: 1.profile_idc, 2.the byte containing the constraint_set flags (currently constraint_set0_flag through constraint_set5_flag, and the reserved_zero_2bits), 3.level_idc. | |
AVC1_CODEC_MAP = { | |
,"avc1.66.30": {profile:"Baseline", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2) | |
"avc1.42001e": {profile:"Baseline", level:3.0, max_bit_rate:10000} | |
,"avc1.42001f": {profile:"Baseline", level:3.1, max_bit_rate:14000} | |
//other variations | |
,"avc1.77.30": {profile:"Main", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2) | |
,"avc1.4d001e": {profile:"Main", level:3.0, max_bit_rate:10000} | |
,"avc1.4d001f": {profile:"Main", level:3.1, max_bit_rate:14000} |
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
/**************************/ | |
/* Credit: colorlib.com */ | |
/**************************/ | |
/*[ FONT SIZE ] | |
/////////////////////////////////////////////////////////// | |
*/ | |
.fs-1 {font-size: 1px;} | |
.fs-2 {font-size: 2px;} | |
.fs-3 {font-size: 3px;} |
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 now = DateTime.Now; | |
var nowUTC = now.ToUniversalTime(); | |
var nowOffset = new DateTimeOffset(now); | |
var nowUTCOffset = new DateTimeOffset(nowUTC); | |
DateTimeOffset nowWithOffset = now; | |
now.Dump("Now"); | |
nowUTC.Dump("Now UTC"); | |
nowOffset.Dump("Now Offset"); | |
nowUTCOffset.Dump("Now UTC Offset"); |
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
.container { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-right: -50%; | |
-webkit-transform: translate(-50%, -50%); | |
transform: translate(-50%, -50%); | |
text-align: center; | |
} |
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" ?> | |
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
autoReload="true"> | |
<variable name="defaultLayout" value="${longdate}|${uppercase:${level}}|${logger}|${message}${onexception:${newline}${exception:format=tostring}}" /> | |
<targets> | |
<target xsi:type="File" name="File" fileName="${basedir}/logs/WebAppAuth.log" | |
archiveEvery="Day" | |
archiveDateFormat="yyyy-MM-dd" | |
archiveNumbering="Date" |
NewerOlder