Skip to content

Instantly share code, notes, and snippets.

/**
* Steganography
* @file main.c
* @author Tomáš Pažourek
*
* @note To see various information on standard output,
* compile with 'DEBUG' preprocessor definition.
* (add '#define DEBUG' or compile with -DDEBUG flag)
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <ncurses.h>
#define DIGIT_SIZE_X 5
#define DIGIT_SIZE_Y 7
#define SPACE_SIZE 2
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@Twinklebear
Twinklebear / main.cpp
Last active February 18, 2024 02:28
Example of render to texture with SDL2
#include <iostream>
#ifdef __linux__
#include <SDL2/SDL.h>
#elif defined(_WIN32)
#include <SDL.h>
#endif
const int WIN_WIDTH = 640;
const int WIN_HEIGHT = 480;
@funkatron
funkatron / json_encoder.html
Created November 4, 2011 14:25
Encode an arbitrary string as JSON
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Encode string content as JSON</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script>
$(document).ready(function() {
$('#encode').click(function(e){
var input = $('#input').val();