Skip to content

Instantly share code, notes, and snippets.

View kerrytazi's full-sized avatar

Alexander Akhundzhanov kerrytazi

View GitHub Profile
@zapstar
zapstar / client.py
Created June 8, 2018 09:01
Python Asyncio SSL client and server examples
#!/usr/bin/env python3
import asyncio
import ssl
@asyncio.coroutine
async def echo_client(data, loop):
ssl_ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_ctx.options |= ssl.OP_NO_TLSv1
@ZaronZ
ZaronZ / gist:fefe7bedd5b1c4fb8ec83b1fc1b9d2c3
Created March 5, 2018 03:20
Pure C project configuration for Visual Studio without CRT
Release/Debug:
General -> Whole Program Optimization -> No Whole Program Optimization
Linker -> Input -> Ignore All Default Libraries = Yes
Linker -> Manifest File -> Generate Manifest = Disabled
Linker -> Advanced -> Entry Point = (set EntryPointName)
C/C++ -> Code Generation -> Security Check = Disable Security Check
C/C++ -> Optimization -> Optimization = Disabled
C/C++ -> General -> SDL checks = (remove value)
C/C++ -> Advanced -> Compile As = Compile as C Code (if need C90)
@matthewzring
matthewzring / markdown-text-101.md
Last active June 21, 2024 14:21
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@csukuangfj
csukuangfj / default-linker-script.txt
Last active May 7, 2024 04:19
This file shows the default linker script of `ld`, use `ld --verbose` to show it.
GNU ld (GNU Binutils for Ubuntu) 2.25.1
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
i386pep
i386pe
@Naios
Naios / functional_unwrap.hpp
Last active July 31, 2023 01:53
C++ functional argument unwrap traits. Extracts argument and return types of functions, std:.function and std::tuple's
/*
* Copyright (C) 2015 Naios <naios-dev@live.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@t-mat
t-mat / unique_ptr-for-FILE.cpp
Created June 24, 2013 11:55
unique_ptr for FILE*
#include <stdio.h>
#include <memory>
int main() {
std::unique_ptr<FILE, int(*)(FILE*)> fp(fopen("test.txt", "r"), fclose);
if(fp) {
char buf[4096];
while(fgets(buf, sizeof(buf), fp.get())) {
printf("%s", buf);
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 21, 2024 03:23
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S