Skip to content

Instantly share code, notes, and snippets.

View vaclavbohac's full-sized avatar

Vaclav Bohac vaclavbohac

View GitHub Profile
@vaclavbohac
vaclavbohac / hanlder.js
Created August 13, 2012 22:32
Inline handler example
/*global document, jQuery */
(function ($) {
'use strict';
$(document).on('click', 'button', (function () {
var labels = ['Edit', 'Apply'],
createInput = function (text) {
return $('<input type="text">').val(text);
@vaclavbohac
vaclavbohac / nette-updater.sh
Created April 30, 2012 13:06
Pull latest changes from nettefw repo with ease and beauty everytime you log in.
#!/bin/bash
REPO=$HOME/repo/nette
SUMMARY="Nette Framework"
MESSAGE="Internet connection not availaible."
sleep 5 # delay for wifi connection
if curl --silent --head http://www.google.com/ | egrep "20[0-9] Found|30[0-9] Found" > /dev/null
then
@vaclavbohac
vaclavbohac / template.phtml
Created February 8, 2012 14:00
VisualPaginator template for Twitter bootstrap.
{*
* VisualPaginator template for Twitter bootstrap.
* @param Paginator $paginator
* @param array $steps
*}
<div n:if="$paginator->pageCount > 1" class="pagination">
<ul>
<li n:class="$paginator->first ? disabled">
<a n:href="this page => $paginator->page - 1">Zpět</a>
@vaclavbohac
vaclavbohac / 10139.cpp
Created January 17, 2012 11:44
Solution to the 10139 (Factovisors) UVa Online Judge problem.
/* Vaclav Bohac (c) 2012 - Problem No. 10139 in C++ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
using std::vector;
@vaclavbohac
vaclavbohac / 10042.cpp
Created January 17, 2012 11:42
Solution to the 10042 (Smith Numbers) UVa Online Judge problem.
/* Vaclav Bohac (c) 2012 - Problem No. 10042 in C++ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
using std::vector;
@vaclavbohac
vaclavbohac / 848.cpp
Created January 14, 2012 23:28
Solution to the 848 (fmt) UVa Online Judge problem.
/* Vaclav Bohac (c) 2012 - Problem No. 848 in C++ */
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
@vaclavbohac
vaclavbohac / build-52.php
Created January 8, 2012 20:48
Makefile for Nette's make
<?php
/**
* Makefile for converting project from PHP 5.3 to PHP 5.2.
*
* Call task 'main' to build a full release.
* The release built will be stored in 'dist' directory.
*/
require 'tools/Nette/nette.min.php';
@vaclavbohac
vaclavbohac / 10012.c
Created October 26, 2011 14:36
Solution to the 10012 UVa Online Judge problem.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
#define ABS(X) ((X) < 0 ? -(X) : (X))
#define MAX_CIRCLES 8
double R[MAX_CIRCLES], C[MAX_CIRCLES];
@vaclavbohac
vaclavbohac / 337.c
Created October 12, 2011 17:30
Solution to the 337 UVa Judge problem
/* Solution to the UVa Online Judge problem no. 337 */
#include <stdio.h>
#include <stdlib.h>
int row, column, insmode = 0, ctrlseq = 0;
char display[10][10];
@vaclavbohac
vaclavbohac / 10013.c
Created October 5, 2011 08:47
Super long sums
/* Solution to the UVa Online Judge problem no. 10013 */
#include <stdlib.h>
#include <stdio.h>
#define MAX_SIZE 1000000
char buffer[4 * MAX_SIZE],
number[MAX_SIZE];