Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Mikulas / byte_mask.cpp
Created May 5, 2012 12:59
Client application memory mapper
const int offset[] = {0x33, 0x38, 0x39, 0x3A, 0x3F, 0x48, 0x49, 0x54, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x74, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x84, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0xD4, 0x120, 0x124};
const int values[] = { 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 68, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 2, 8, 8};
@Mikulas
Mikulas / gist:2770600
Created May 22, 2012 17:57
Nginx dynamic domain with redirect to root
server {
server_name ~^(:?(?<second>.+)\.)?(?<domain>[^.]+\.[^.]+)$;
set $test "";
if ($second !~ "^$") {
set $test "${test}S";
}
if (-d /srv/virtual_hosts/$second.$domain) {
set $test "${test}E";
}
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{textcomp}
\title{Laboratorní práce}
\date{}
\setlength{\topmargin}{0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\title{Jídelní lístek}
\date{}
\begin{document}
\maketitle
\Large Pondělí \normalsize
\begin{enumerate}
@Mikulas
Mikulas / gist:3240580
Created August 2, 2012 20:56
/etc/fstab
UUID=E720E872-A309-3595-B74B-52FC5F3CDABD /Users hfs auto
UUID=6D5599BA-93D2-323A-8B81-2F11496C13B1 none hfs rw,noauto
UUID=CAF924E8-2AA6-35C2-BA58-E68FE4E63308 none hfs rw,noauto
@Mikulas
Mikulas / Google.php
Created August 21, 2012 13:21
GoogleAuth
<?php
use \Nette\Utils\Json;
/**
* Minimalistic Google OAuth2 connector
* @author Mikuláš Dítě
* @license BSD-3
*/
class Google extends Nette\Object
@Mikulas
Mikulas / config.neon
Created August 22, 2012 08:23
Nette user login for Adminer Editor
common:
parameters:
adminer_editor:
role: moderator
database:
host: localhost
dbname: yourDbName
user: yourDbUser
password: yourDbOass
@Mikulas
Mikulas / gist:3423760
Created August 22, 2012 08:29
GithubShare Enhanced New BSD License
Copyright (c) Mikuláš Dítě, 2012
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
@Mikulas
Mikulas / LaTeX.sublime-build
Created November 12, 2012 20:21
Mac OS X LaTeX build script for Sublime Text 2
{
"cmd": ["php", "/Volumes/Data/Scripts/latex_build.php", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
//"target": "exec_in_window", // https://github.com/vhyza/exec-in-window
"selector": "text.tex.latex"
}
@Mikulas
Mikulas / etc-init.d-nginx
Created November 14, 2012 17:48
Server setup
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu <=9.10.
# Description: nginx init.d dash script for Ubuntu <=9.10.
### END INIT INFO