Skip to content

Instantly share code, notes, and snippets.

View ssg's full-sized avatar
馃暐
loading

Sedat Kapano臒lu ssg

馃暐
loading
View GitHub Profile
@Mr-Precise
Mr-Precise / vs_buildtools_dl_list.md
Last active November 8, 2026 15:51
MSVC / VS / Buildtools download link collection list
@loveemu
loveemu / xm-form-ja.md
Last active September 10, 2026 15:09
The "Complete" XM module format specification v0.81
@fay59
fay59 / Quirks of C.md
Last active May 19, 2026 17:27
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@sinclairtarget
sinclairtarget / bernoulli.c
Created August 17, 2018 20:22
Lovelace's Note G Program in C
#include <stdio.h>
/*
* Calculates what Ada Lovelace labeled "B7", which today we would call the 8th
* Bernoulli number.
*/
int main(int argc, char* argv[])
{
// ------------------------------------------------------------------------
// Data
@davidfowl
davidfowl / Global.asax.cs
Last active December 4, 2025 20:12
ASP.NET MVC and ServiceCollection sample
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Microsoft.Extensions.DependencyInjection;
using WebApplication16;
using WebApplication16.Controllers;
@cbmeeks
cbmeeks / sid.txt
Last active October 22, 2026 16:05
SID File Format
===========================
SID FILE FORMAT DESCRIPTION
===========================
AUTHORS:
Michael Schwendt (PSID v1 and v2)
Simon White (PSID v2NG, RSID)
Dag Lem (PSID v2NG)
Wilfred Bos (PSID v3, RSID v3, PSID v4, RSID v4)
@jt000
jt000 / ServiceProviderControllerActivator.cs
Last active June 30, 2026 20:49
Using Microsoft.Extensions.DependencyInjection in WebAPI 2
using System;
using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Dispatcher;
using Microsoft.Extensions.DependencyInjection;
namespace Web
{
public class ServiceProviderControllerActivator : IHttpControllerActivator
{
@andriybuday
andriybuday / 0 - ServiceHost.cs
Last active June 30, 2026 20:53
Microsoft.Extensions.DependencyInjection with OWIN Self-Hosted WebAPI
// ...
using Microsoft.Owin.Hosting;
// ...
public class ServiceHost
{
private IDisposable server = null;
const string baseAddress = "https://*:443";
public void Start()
@atesgoral
atesgoral / validate.js
Last active March 28, 2016 09:26
Turkish Citizenship ID Validator
n=>{a=[].slice.call(n,0,9);a.push(a.reduce((s,d,i)=>{return s+d*(((i+1&1)*8)-1)},0)%10,a.reduce((s,d)=>{return s+1*d},0)%10);return n==a.join('')}
@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active March 22, 2023 03:06
Discussion of korn.c, 1987 IOCCC entry, mentioned in http://stackoverflow.com/a/19214007/827263

korn.c is the "Best One Liner" winner of the 1987 International Obfuscated C Code Contest, by David Korn (yes, the author of the Korn Shell).

korn.hint, as the name implies, offers some hints.

A commenter on Stack Overflow asked for some clarification. I didn't want to post spoilers on the site, so I'm posting them here instead. If you haven't already (and if you're familiar with the rules of C) I encourage you to study the program for a while first.

=====

Here's the code: