Skip to content

Instantly share code, notes, and snippets.

View markspolakovs's full-sized avatar

Marks Polakovs markspolakovs

View GitHub Profile
@markspolakovs
markspolakovs / Dockerfile.136
Created December 31, 2022 10:59
MW 1.36->1.37 postgres upgrade issue repro
FROM mediawiki:1.36.4
RUN apt update && apt install -y libpq-dev && docker-php-ext-install pgsql pdo_pgsql
@markspolakovs
markspolakovs / Listen.ts
Created December 6, 2020 13:13
Repro for openapi-generator issue
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@markspolakovs
markspolakovs / MarkdownEditor.tsx
Created March 20, 2018 13:31
side-by-side editor
import * as React from "react";
import 'react-mde/lib/styles/css/react-mde-all.css';
import showdown from "showdown";
const showdownOptions = require("../lib/showdown/showdown.config");
const { imageExtension } = require("../lib/showdown/extensions")(showdown);
showdown.extension('imageExtension', imageExtension);
@markspolakovs
markspolakovs / main.md
Created May 3, 2017 19:59
ES6 Class Method Binding

ES6 Class this binding

I mentioned that ES6 class methods don't automatically bind this to the class instance, so the following doesn't work:

class ListItem extends React.Component {
  handleClick() {
    this.setState({ completed: true });
  }
 
@markspolakovs
markspolakovs / README.md
Created August 12, 2016 11:45
React component for temperature

If anyone wants a reusable React component for displaying temperature in either Fahrenheit or Celsius, here's one:

class Temperature extends React.Component {
  constructor(props) {
    super(props);
  }
  fToC(f) {
    return (f - 32) * (5 / 9);
  }
 cToF(c) {

Keybase proof

I hereby claim:

  • I am markspolakovs on github.
  • I am markspolakovs (https://keybase.io/markspolakovs) on keybase.
  • I have a public key whose fingerprint is 4278 D693 3B03 9574 FA05 FED9 5D72 6BC0 8306 5C1C

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="master.css"/>
</head>
<body>
<nav class="navbar">
@markspolakovs
markspolakovs / shaders.cpp
Created September 4, 2014 17:10
shaders shaders SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS SHADERS
#include "shaders.h"
#include <fstream>
#include <iostream>
GLuint vert_shader = -1;
GLuint frag_shader = -1;
void compileShader(GLenum type, const std::string path)
{
switch(type)
@markspolakovs
markspolakovs / main.h
Created September 1, 2014 08:26
Texture loading
#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
#include <GLFW/glfw3.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
@markspolakovs
markspolakovs / gist:393d8d3a2394751fab9f
Last active August 29, 2015 14:05
Test for a database format of mine
collection testcol
structure
float damage def 0
unsigned int cost
string name
bool quest def false
endstructure
collection testcol
create