Skip to content

Instantly share code, notes, and snippets.

View Vinatorul's full-sized avatar
🛍️
Working on Yandex Lavka

Alexander Kuvaev Vinatorul

🛍️
Working on Yandex Lavka
View GitHub Profile
@Vinatorul
Vinatorul / SDLforUbuntu12.04.md
Last active November 17, 2024 18:27
SDL2.0 for Ubuntu 12.4

Problem summary

Ubuntu 12.04 doesn't support SDL2.0 from "box" so here is a short instruction what to do, if you faced the same problem as me.

Installation

We will install SDL2.0 from sources. First of all we need to install dependencies (same as for SDL1.2) and mercurial:

$ sudo apt-get build-dep libsdl1.2-dev 
$ sudo apt-get install mercurial 
@Vinatorul
Vinatorul / DarkTwitter.css
Created November 9, 2015 12:22
Dark Twitter css+mozpreproc
@-moz-document url("https://twitter.com/"), url("https://twitter.com/i/notifications"), url-prefix("https://twitter.com/mentions"), url-prefix("https://twitter.com/i/moments"), url-prefix("https://twitter.com/settings") {
body{
background-color: #191919 !important;
}
a {
color: #E0D28F !important;
}
}
@-moz-document url-prefix("https://twitter.com/intent") {

Keybase proof

I hereby claim:

  • I am vinatorul on github.
  • I am vinatorul (https://keybase.io/vinatorul) on keybase.
  • I have a public key ASCL5BhrqJPb36da9LJwaf3GmGXNgGuGvC0MR9G_bDva_go

To claim this, I am signing this object:

@Vinatorul
Vinatorul / contest_helper.sh
Last active February 18, 2017 22:30
Script to help create template projects and build them during programming contests. See http://codeforces.com/submissions/Vinatorul
#!/bin/bash
dest_dir=bin
if [ ! -d $dest_dir ]; then
mkdir $dest_dir
fi
binary=$dest_dir/$3
in_file=$dest_dir/$3".in"
case $1 in
"--cxx")
# go to your repository
cd my_project
# check your existing remote
git remote -v
# origin [email protected]:my_project.git (fetch)
# origin [email protected]:my_project.git (push)
# Add a new remote, a github.com private repository for example
# the --mirror flag is what's different from a simple new remote
@Vinatorul
Vinatorul / flask_web_server.py
Last active November 10, 2017 13:20
Minimalistic Flask web server
import os
import sys
from flask import Flask, request, redirect, url_for, send_from_directory
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.abspath('user_info.db')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False # SQLALCHEMY_TRACK_MODIFICATIONS deprecated
app.config['SERVER_NAME'] = # NAME
app.config['SERVER_PORT'] = # Port