Skip to content

Instantly share code, notes, and snippets.

View tajo's full-sized avatar
🙌
Use Ladle. Be happy.

Vojtech Miksu tajo

🙌
Use Ladle. Be happy.
View GitHub Profile
@tajo
tajo / returning
Created December 4, 2012 06:25
Return to the position before expanding
<script>
function saveLoc(element){
if(!element.getBoundingClientRect) return function(){};
var top = element.getBoundingClientRect().top;
return function(){
window.scrollBy(0, element.getBoundingClientRect().top - top);
};
}
$(document).ready(function() {
@tajo
tajo / gist:4230544
Created December 7, 2012 03:33
Ponork
/*
* File: ponork.c
* Author: Vojta
*
* Created on December 13, 2011, 8:29 PM
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@tajo
tajo / gist:4230545
Created December 7, 2012 03:33
Transmit
/*
* File: transmit.c
* Author: Vojta
*
* Created on December 14, 2011, 10:05 AM
*/
#include <stdio.h>
#include <stdlib.h>
@tajo
tajo / gist:4486997
Created January 8, 2013 19:17
List of my TV Show
Band of Brothers
Big Bang Theory
Black Books
Blue Mountain State
Breaking Bad
Community
Dexter
Friends
House
How I Met Your Mother
@tajo
tajo / gist:7007625
Created October 16, 2013 13:20
Double compare
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
double a = 1.0 / 10.0;
double b = a * 10 - 1;
if (b == 0.0)
@tajo
tajo / gist:7967419
Created December 15, 2013 01:15
Counts FB messages
function counting(arr) {
var a = [], b = [], prev;
arr.sort();
for ( var i = 0; i < arr.length; i++ ) {
if ( arr[i] !== prev ) {
a.push([arr[i], 1]);
} else {
a[a.length-1][1]++;
}
#!/usr/bin/python
import os
from PyPDF2 import PdfFileMerger, PdfFileReader
subs = ['BI-AAG','BI-APS','BI-BEZ','BI-CAO','BI-DBS','BI-EFA','BI-EIA','BI-GRA','BI-LIN','BI-MLO','BI-OSY','BI-PA1','BI-PA2','BI-PJP','BI-PSI','BI-PST','BI-SAP','BI-SI1','BI-VZD','BI-ZDM','BI-ZMA']
folder = "okruhy"
# traverse root directory, and list directories as dirs and files as files
for sub in subs:
#!/usr/bin/python
import binascii
import sys
import time
import base64
from des import *
_pythonMajorVersion = sys.version_info[0]
def xor_bits(list1, list2):
res = []
#!/usr/bin/python
import sys
import time
import binascii
from des_wrapper import des_decrypt
_pythonMajorVersion = sys.version_info[0]
def bitfield(n):
bits = [int(digit) for digit in bin(n)[2:]]
const prettier = require('prettier');
const glob = require('glob');
const fs = require('fs');
// check if the glob was passed (user wants to run it only for a subset of files)
const args = process.argv.slice(2);
console.log(args[0]);
const files = glob.sync(args[0] ? args[0] : '**/*.js', {
ignore: [