Skip to content

Instantly share code, notes, and snippets.

Dmitriy Vlasov DmitriyVlasov

Block or report user

Report or block DmitriyVlasov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DmitriyVlasov
DmitriyVlasov / DeedleFormatter.fsx
Created Nov 20, 2017 — forked from mndrake/DeedleFormatter.fsx
Deedle Series and IFrame formatter for IFSharp
View DeedleFormatter.fsx
#I "../lib"
#r "FSharp.Markdown.dll"
#r "FSharp.Literate.dll"
#r "Deedle.dll"
open System.IO
open Deedle
open Deedle.Internal
open FSharp.Literate
open FSharp.Markdown
@DmitriyVlasov
DmitriyVlasov / GIF-Screencast-OSX.md
Created Oct 13, 2016 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@DmitriyVlasov
DmitriyVlasov / system.windows.forms.powerstatus.fsx
Created Jun 30, 2016
Пример работы с классом PowerStatus из WinForms
View system.windows.forms.powerstatus.fsx
// https://msdn.microsoft.com/ru-ru/library/system.windows.forms.powerstatus(v=vs.110).aspx
// http://www.codeproject.com/Articles/30414/Getting-Started-in-F-A-Windows-Forms-Application
open System
open System.Drawing
open System.Windows.Forms
type MainForm() as form =
inherit Form()
// Define private variables
@DmitriyVlasov
DmitriyVlasov / latency.markdown
Created Dec 8, 2015 — forked from valadan/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
View gist:bd6ca0f08229af368116
//------------------------------------------
// Step 0. Boilerplate to get the paket.exe tool
open System
open System.IO
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
if not (File.Exists "paket.exe") then
let url = "http://fsprojects.github.io/Paket/stable"
@DmitriyVlasov
DmitriyVlasov / paket-from-fsharp-repl.fsx
Last active Nov 7, 2015
Использование paket из интерактивной сессии F#
View paket-from-fsharp-repl.fsx
// Делаем текущий каталог рабочей директорией
System.Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
// Если файл paket.exe не существует загружаем его
if not (System.IO.File.Exists "paket.exe") then
let url = "http://fsprojects.github.io/Paket/stable"
use wc = new System.Net.WebClient()
let tmp = System.IO.Path.GetTempFileName()
let stable = wc.DownloadString(url)
wc.DownloadFile(stable,tmp)
@DmitriyVlasov
DmitriyVlasov / ianaMediaTypeTable.fs
Created Nov 1, 2015
Пример использования провайдера типа CsvProvider из библиотеки FSharp.Data на примере получения таблицы медиа типов официально предоставляемых консорциумом IANA.
View ianaMediaTypeTable.fs
#I @"../../packages/FSharp.Data/lib/net40"
#r @"FSharp.Data.dll"
open FSharp.Data
[<Literal>]
let ianaCsvSample = "Name,Template,Reference
1d-interleaved-parityfec,application/1d-interleaved-parityfec,[RFC6015]"
@DmitriyVlasov
DmitriyVlasov / Excel4.fs
Created Oct 2, 2015 — forked from mndrake/Excel4.fs
A F# wrapper class for the Excel4/Excel12 methods contained in Excel-DNA to mimic basic methods of the COM object model
View Excel4.fs
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Utility
@DmitriyVlasov
DmitriyVlasov / ExampleExportCsv.ps1
Created Aug 18, 2015
Корректный экспорт данных в CSV русскоязычных букв.
View ExampleExportCsv.ps1
# Выгружает в формате csv без вставки в заголовок файла описание типа, в кодировке Юникод.
export-csv -Path C:\temp\export.csv -Delimiter ';' -NoTypeInformation -Encoding Unicode
@DmitriyVlasov
DmitriyVlasov / UpdatePowerShellHelpOverProxy.ps1
Created Aug 6, 2015
Обновление справки Powershell через прокси сервер
View UpdatePowerShellHelpOverProxy.ps1
$webclient = New-Object System.Net.WebClient
$creds = Get-Credential
$webclient.Proxy.Credentials = $creds
Update-Help -Credential $creds
You can’t perform that action at this time.