Skip to content

Instantly share code, notes, and snippets.

View fiyazbinhasan's full-sized avatar
☠️
Get busy living or get busy dying

Fiyaz Bin Hasan fiyazbinhasan

☠️
Get busy living or get busy dying
View GitHub Profile
let xhr = new XMLHttpRequest();
xhr.open('GET', 'https://jsonplaceholder.typicode.com/posts');
xhr.send();
xhr.onload = function() {
if(xhr.status != 200)
alert(`Error ${xhr.status}`);
else
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace MysteryOfDelegates
{
public class Clock
{
public DateTime Alarm { get; set; }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace MysteryOfDelegates
{
public class Post
{
public int Id { get; set; }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace MysteryOfDelegates
{
public class Post
{
public int Id { get; set; }
using System;
using System.Collections;
using System.Collections.Generic;
namespace Demo6thOct
{
class Program
{
public delegate void FunctionPointer();
using System;
using System.Collections.Generic;
namespace PrimitiveAndComplexTypes
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
[HttpGet("{id:guid}", Name = "CustomerGet")]
public IActionResult Get(Guid id)
{
if (Request.Headers.ContainsKey("If-None-Match"))
{
var oldETag = Request.Headers["If-None-Match"].First();
if (_cache.Get($"Customer-{id}-{oldETag}") != null)
{
return new StatusCodeResult(304);
}
var handler = new HttpClientHandler { AllowAutoRedirect = false };
var client = new HttpClient(handler);
client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html"));
client.DefaultRequestHeaders.Add("Accept-Language", "en-US,en;q=0.5");
client.DefaultRequestHeaders.TryAddWithoutValidation("Accept-Encoding", "gzip, deflate");
var basePage = await client.GetStreamAsync("http://www.kalerkantho.com/print-edition/editorial/");
using (var deflateStream = new GZipStream(basePage, CompressionMode.Decompress))
var origins = await vm.GetManualData();
foreach (var origin in origins)
{
foreach (var intersection in origin.Intersections)
{
BasicGeoposition position = new BasicGeoposition();
if (intersection.IntersectionLocation != null && intersection.Intensity != null)
{
<Grid x:Name="HamburerPane"
Margin="-480,0,0,0">
<Grid.Projection>
<PlaneProjection/>
</Grid.Projection>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>