Skip to content

Instantly share code, notes, and snippets.

@mochja
mochja / smerniky.c
Created May 2, 2012 15:46
smerniky C
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void gen(int* a, int size) // tu miesto int* a, mozeme pouzit aj zapis int a[], tu je vidiet ze pole je vlastne pointer, size je velkost pola
{
int i;
srand(time(NULL));
for(i = 0; i < size; i++)
@mochja
mochja / create.php
Created December 16, 2012 22:35
just create subdomain
<?php
echo 'Name of domain: ';
$app = trim(fgets(STDIN));
mkdir("/Users/janmochnak/Sites/$app.dev");
mkdir("/Users/janmochnak/Sites/$app.dev/logs");
mkdir("/Users/janmochnak/Sites/$app.dev/public");
@mochja
mochja / main.c
Created February 11, 2013 17:47
Author: Jan Mochnak, 2012; Program, ktory simuluje hru na kos. N hracov hadze na kos ak hrac nehodi kos ale hrac pred nim kos hodi, tak aktualny hrac vypadava. Vitazi posledny hrac.
#include <stdio.h>
#include <time.h>
// author: Jan Mochnak
int main ()
{
srand(time(NULL));
<?php
// phpinfo(); exit;
require __DIR__.'/../vendor/autoload.php';
Tracy\Debugger::enable(false);
class TwigView extends \Slim\View {
int main(int argc, const char * argv[])
{
clrscr();
int v = 10;
int i, j;
int x = 1;
int y = 1;
for (i = 1; i <= v; i++) {
@mochja
mochja / sxt.markdown
Last active December 16, 2015 08:18
pisomka z sxt 17.4.

budete pracovat na disku D:/ ak chcete skusat prikazy na kompe, treba otvorit cmd (win logo+r -> cmd) a napisat D:, mala by sa vam cesta zmenit na D:, resp. doporucujem robit hned na virtalboxe, pretoze posledne ulohy nespravite na virtuale (kvoly permissions)

neviem presne znienie ale mate nastavit prompt na zlozku a datum

prompt $P$D

vytvorit zlozku

@mochja
mochja / function.less
Last active December 20, 2015 23:49
Split images, make opacity version, LESS function. (all icons are in simple png file along with hover versions)
@img-count: 4; // you need keep count of your images
@icon-width: 40px;
.image-icon (@pos: 0) when (@pos = 1) {
background-position-y: 0;
&:hover, &.active {
background-position-y: (@icon-width * -@img-count);
}
}
online 2.525 ms
@mochja
mochja / gist:7781397
Last active December 30, 2015 05:18
Zenit 3 987654327 2 5 vypocita zvysok velkeho exponencialneho cisla. - http://stackoverflow.com/questions/5989429/pow-and-mod-function-optimization
uint64_t expmod(uint64_t base, uint64_t exp, uint64_t mod ){
if (exp == 0) return 1;
return (exp % 2 == 0) ? ( ((uint64_t) pow( expmod( base, (exp / 2), mod), 2) ) % mod ) : ((base * expmod( base, (exp - 1), mod)) % mod);
}
➜ myProject1 brew install hhvm --HEAD
==> Cloning https://github.com/facebook/hhvm.git
Updating /Library/Caches/Homebrew/hhvm--git
==> Patching
patching file hphp/runtime/base/program-functions.cpp
Hunk #1 FAILED at 1144.
1 out of 1 hunk FAILED -- saving rejects to file hphp/runtime/base/program-functions.cpp.rej
patching file hphp/runtime/ext/gd/libgd/gdft.cpp
Hunk #1 FAILED at 61.
1 out of 1 hunk FAILED -- saving rejects to file hphp/runtime/ext/gd/libgd/gdft.cpp.rej