Skip to content

Instantly share code, notes, and snippets.

View psqq's full-sized avatar
🙃
Where is my mind?

Sergey Pestov psqq

🙃
Where is my mind?
View GitHub Profile
@psqq
psqq / README.md
Last active March 29, 2020 09:42
Id generator

Id generator.

Install

yarn add gist:14b0e71326d41620ca3957e850f4b05f

Use

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"runtimeExecutable": "/usr/bin/chromium",
"type": "chrome",
"request": "launch",
@psqq
psqq / links.txt
Last active January 9, 2020 06:19
from Tkinter import *
import math
def draw_sin(a1, a2):
c.delete("all")
center = height//2
x_start = a1
x_max = width
x_increment = 1
x_factor = (a2 - a1) / 400
@psqq
psqq / main.cpp
Last active June 21, 2017 20:27
Minimal SDL2 app example
#include <iostream>
#include <exception>
#include <SDL.h>
using namespace std;
class Exception : public exception {
string msg;
public:
Exception(string amsg) : msg(amsg) {}
const char* what() const noexcept {
@psqq
psqq / main.cpp
Last active September 15, 2024 04:07
Simple SDL_net example
#include <SDL.h>
#include <SDL_net.h>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main(int argc, char **argv) {
if (SDL_Init(0) == -1) {
printf("SDL_Init: %s\n", SDL_GetError());
@psqq
psqq / .clang-format
Last active June 7, 2017 18:49
My configs
BasedOnStyle: LLVM
IndentWidth: 2
ColumnLimit: 80
@psqq
psqq / main.cpp
Last active June 6, 2017 00:20
Наследование и текучий интерфейс
#include <iostream>
using namespace std;
class Base {
int propertyBase;
public:
template<class T>
T& setPropertyBase(int propertyBase) {
this->propertyBase = propertyBase;
return *(T*)this;