Skip to content

Instantly share code, notes, and snippets.

View AxelUser's full-sized avatar
🕊️
Never again

Alexey Maltsev AxelUser

🕊️
Never again
View GitHub Profile
@AxelUser
AxelUser / rtfm.cs
Last active October 3, 2019 09:12
One more reason to read specification
using System;
namespace RTFM
{
class Program
{
private struct Mutable
{
private int x;
public int Mutate()
taskkill /f /im chrome.exe
"C:\Program Files (x86)\VideoLAN\VLC\VLC.exe" "%USERPROFILE%\Videos\Rick Astley - Never Gonna Give You Up.mp4"
using System;
using System.Collections.Generic;
namespace ProITR.Asur.Isur.Coordinate.Handler.Handlers.MessageHandlers
{
public class MessageTypeSwitch
{
private object _messageToCast;
private Dictionary<Type, Action> _mappedActions = new Dictionary<Type, Action>();
@AxelUser
AxelUser / count_letters.js
Created June 19, 2017 09:26
Count letters in substring.
/**
* Count letters in substring.
*/
function strInput(str) {
var letterMap = {};
var letterArray = [];
for(var index = 0; index < str.length; index++){
if(letterMap[str[index]] !== undefined){
@AxelUser
AxelUser / ReSharperFeaturesLecture.md
Last active May 24, 2017 14:34
Info about lecture of ReSharper Features
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using AngleSharp;
using System.Text.RegularExpressions;
using AngleSharp.Dom;
using AngleSharp.Extensions;
@AxelUser
AxelUser / base64toBlob.js
Last active October 31, 2016 08:25
Convert base64 string to Blob
function base64toBlob(b64Data, contentType, sliceSize) {
contentType = contentType || '';
sliceSize = sliceSize || 512;
var byteCharacters = atob(b64Data);
var byteArrays = [];
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
var slice = byteCharacters.slice(offset, offset + sliceSize);
@AxelUser
AxelUser / download_ajax.js
Last active January 26, 2024 09:12
How to download file in base64 format by ajax request to your api
$.ajax({
url: "http://api.yoursite.com",
data: data,
type: "POST"
}).done(function(result) {
var link = document.createElement("a");
document.body.appendChild(link);
link.setAttribute("type", "hidden");
link.href = "data:text/plain;base64," + result;
link.download = "data.zip";