Skip to content

Instantly share code, notes, and snippets.

View Kedrigern's full-sized avatar

Ondřej Profant Kedrigern

View GitHub Profile
@Kedrigern
Kedrigern / load-file.cpp
Last active October 1, 2015 19:57
C++: Loading file example.
// MSVS spouští program ve složce projektu, např:
// C:\Users\keddie\Documents\Visual Studio 2010\Projects\<name>
void print(char c) {
cout << c;
}
int _tmain()
{
ifstream in("in.txt", ifstream::in); // V MSVS se aplikace spousti v hlavni slozce aplikace
@Kedrigern
Kedrigern / CPP elementary.cpp
Created March 15, 2012 23:47
C++: Basic example of template and std libs.
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
template <typename T>
void print(T element) {
cout << element << ' ';
}
@Kedrigern
Kedrigern / frp.sh
Last active September 29, 2015 14:17
BASH: Find and replace index entry in LaTeX files with many options.
#!/bin/bash
#==============================================================================
#
# FILE: frp.sh
#
# USAGE:
# ./frp.sh --list list.txt -f text.tex
# ./frp.sh --help
#
# DESCRIPTION: Finds the patterns from list in LaTeX source code and replaces them by index entry.
@Kedrigern
Kedrigern / ThreadsAndGui.cs
Created November 18, 2011 17:41
Threads oriented gui and concept of programm. Small example.
using System;
using System.Threading;
using Gtk;
namespace koncept
{
public static class MainClass
{
/* locks */
public static object lockEnd;
@Kedrigern
Kedrigern / Tree.hs
Last active October 29, 2024 15:35
Implementation of binary search tree in Haskell
{- Implementation of BST (binary search tree)
Script is absolutly free/libre, but with no guarantee.
Author: Ondrej Profant -}
import qualified Data.List
{- DEF data structure -}
data (Ord a, Eq a) => Tree a = Nil | Node (Tree a) a (Tree a)
deriving Show
@Kedrigern
Kedrigern / Convert2cmyk.sh
Created September 23, 2011 20:50
My small but smart script for batch converting (and other manipulation) images to cmyk colorspace.
#!/bin/bash
# What do: Converting, manipulating etc. jpegs to CMYK colorspace
# Script is absolutly free/libre, but no guarantee.
# Author: Ondřej Profant
function 2cmyk {
echo -e "[info]\tThis operation needs a lot of CPU resources. Probably will take a long time."
for i in *.jpg ; do
mv $i ${i%.jpg}rgb.jpg
convert -depth 8 -colorspace cmyk -alpha Off ${i%.jpg}rgb.jpg ${i%.jpg}cmyk.jpg