Skip to content

Instantly share code, notes, and snippets.

@Markonis
Markonis / boiler.css
Created November 11, 2015 12:14
A simple, but effective CSS boilerplate. This assumes you have some kind of reset/normalize going on as well.
html {
font-size: 12px ;
font-family: 'Open Sans', sans-serif;
}
div {
position: relative;
box-sizing: border-box;
}
@Markonis
Markonis / gdi-draw-something.cpp
Last active December 2, 2015 21:08
Draw something with GDI
void CMyView::DrawSomething(CDC* pDC, bool m) {
CPen newPen(PS_SOLID, VariablePenWidth(5), RGB(0, 0, 0));
CPen* oldPen = pDC->SelectObject(&newPen);
CBrush brush;
brush.CreateSolidBrush(RGB(128, 224, 255));
CBrush* oldBrush = (CBrush*)pDC->SelectObject(&brush);
int prevMode = SetGraphicsMode(pDC->m_hDC,GM_ADVANCED);
XFORM Xform, XformOld;
@Markonis
Markonis / gdi-double-buffer.cpp
Created December 2, 2015 10:45
Double buffer with GDI
void CLab1View::OnDraw(CDC* pDC)
{
CLab1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// Setup coordinate system
GetClientRect(&clientRect);
pDC->SetMapMode(MM_ISOTROPIC);
#include "StdAfx.h"
#include "GLRenderer.h"
#include "GL\gl.h"
#include "GL\glu.h"
#include "GL\glaux.h"
#include "GL\glut.h"
#include "DImage.h"
#pragma comment(lib, "GL\\glaux.lib")
CGLRenderer::CGLRenderer(void)
DEFAULT = {
name: 'Marko Pavlovic',
email: '[email protected]'
}
puts 'Enter authors names:'
names = gets
puts 'Enter authors emails:'
emails = gets
import * as m from 'mithril';
import { State } from '../model/state';
import { Photo } from '../model/photo';
import { NestedCSSProperties } from 'typestyle/lib/types';
const UTM = '?utm_source=resplash&utm_medium=referral';
const UNSLPASH_URL = `https://unsplash.com${UTM}`;
const style: NestedCSSProperties = {
position: 'absolute',
defmodule Parallel do
def map(enumerable, fun) do
parent = self
chunk_size = chunk_size(enumerable)
enumerable
|> Enum.chunk(chunk_size, chunk_size, [])
|> Enum.map(fn chunk ->
spawn fn -> map_chunk(parent, chunk, fun) end
end)
public class TeaTest {
@Test
public void testEncryptDecryptBlock() {
Configuration config = new Configuration();
config.set("blockLength", "8");
config.set("key", "111 222 333 444");
Tea instance = new Tea(config);
export interface Recipe {
id: string
title: string
}
export class ApiEndpoint<TInput, TOutput>{
public path: string[] = [];
public pathStr() { return '/' + this.path.join('/') }
}