Skip to content

Instantly share code, notes, and snippets.

View avspeed's full-sized avatar
🎯
Focusing

Team@AVSPEED avspeed

🎯
Focusing
  • AVSPEED
  • CARY, NC
View GitHub Profile
package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {
@avspeed
avspeed / gist:ab60168afe7362cc6e4b
Last active August 29, 2015 14:03
JavaScript calculate distance between 2 points
function toRad(value) {
var RADIANT_CONSTANT = 0.0174532925199433;
return (value * RADIANT_CONSTANT);
}
function calculateDistance(starting, ending) {
var KM_RATIO = 6371;
try {
var dLat = toRad(ending.latitude - starting.latitude);
var dLon = toRad(ending.longitude - starting.longitude);
/* =============================================================
* bootstrap-typeahead.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@avspeed
avspeed / TcpClose.cs
Created November 2, 2016 16:07
Close ports / existing connections
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Runtime.InteropServices;
namespace ConnectionManager
{
class Disconnector
@avspeed
avspeed / OpenWindowGetter.cs
Created January 20, 2018 00:04
Enumerate open windows
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AVSPEED.Helper
{
using System.Runtime.InteropServices;
using HWND = IntPtr;
@avspeed
avspeed / build-chromium-windows.bat
Created March 3, 2018 02:08 — forked from apla/build-chromium-windows.bat
Build CEF# from source with mp4
@echo off
REM instructions from: https://groups.google.com/d/msg/cefsharp/BJLMXl9c204/HMJlp8mZzF0J
REM seems like partial instructions copied to SO: http://stackoverflow.com/questions/8033495/chromium-embedded-framework-mp3-support
REM all chromium releases: https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md#markdown-header-release-branches
REM 2272 - latest chromium with npapi (41)
REM there is a commits list: https://bitbucket.org/chromiumembedded/cef/branch/2272
REM https://github.com/cefsharp/CefSharp
REM cef builds http://www.magpcss.net/cef_downloads/
REM https://cefbuilds.com
@avspeed
avspeed / cmd build
Created March 6, 2018 17:25
cefbuild
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>d:
D:\>cd code
D:\code>dir
Volume in drive D is FreeAgent GoFlex Drive
Volume Serial Number is 8867-3932
@avspeed
avspeed / flex.css
Last active April 8, 2018 11:09
flex html
#flexcanvas{
width: 100%;
height: 600px !important;
}
.rowParent, .columnParent{
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
@avspeed
avspeed / GetDevices.cs
Created May 8, 2018 12:10
get devices
RTCControl rtcControl;
rtcControl = new RTCControl();
//event triggered when new devices are found
rtcControl.NewDevices += RtcControl_NewDevices;
....