Skip to content

Instantly share code, notes, and snippets.

View Witiko's full-sized avatar

Vít Starý Novotný Witiko

  • Brno, Czech Republic
View GitHub Profile
@Witiko
Witiko / DayTime.js
Created September 6, 2013 10:59
An event-based library calculating the sunrise and sunset times.
var DayTime; (function() {
var DAWN = 0, // Function flags
DUSK = 1,
DAY = 0, // Status flags
NIGHT = 1;
DayTime = function(latitude, longitude) {
if(latitude === undefined ||
longitude === undefined)
throw new Error("Define both the latitude and longitude!");
@Witiko
Witiko / Screen.js
Created September 6, 2013 11:00
An event-based screen dimensions library
/*
Screen library
Copyright (C) 2010 Vít Novotný
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@Witiko
Witiko / Comp.js
Created September 6, 2013 11:01
A set of useful functions I've created over the years of my javascript programming
/*
Compatible Now! ~ Vít Novotný 2009 - 2011
Requires:
* Ecma5.js
*/
(function(Array, String, undefined) {
@Witiko
Witiko / SexyDollar.js
Created September 6, 2013 11:02
A simple DOM query library
/*
SexyDollar library by Witiko
Function $()
1st argument: "tagName", "#id", ".className", "tagName.className", "@name", "tagName@name"
2nd argument: parentElement (optional)
*/
@Witiko
Witiko / SexyDollar+.js
Created September 6, 2013 11:03
A simple DOM query library with some added complexity
/*
SexyDollar Extended library by Witiko
Function $()
1st argument: "tagName", "#id", ".className", "tagName.className", "@name", "tagName@name"
2nd argument: Array / NodeList / Element parentElement (optional)
*/
@Witiko
Witiko / EasyUserData.js
Created September 6, 2013 11:05
User data (IE-only data storage technique) interfacing library
/*
EasyUserData library
A lightweight solution for basic userData handing
Copyright (C) 2010 Vít Novotný
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@Witiko
Witiko / EasyCookie.js
Created September 6, 2013 11:05
A cookie interfacing library
/*
EasyCookie library
A lightweight solution for basic cookies handing
Copyright (C) 2010 Vít Novotný
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@Witiko
Witiko / Stored.js
Last active December 22, 2015 10:59
A library that allows the storing of user data on any browser which supports either localStorage, globalStorage cookies or user data. The script makes use of the EasyCookie.js, EasyUserData.js and Comp.js libraries.
/*
Stored! - A standalone localStorage emulation library
Copyright (C) 2011 Vít Novotný
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
#include <unistd.h> /* STDIN_FILENO */
#include <locale.h> /* LC_ALL, setlocale() */
#include <langinfo.h> /* nl_langinfo(), CODESET */
#include <wchar.h> /* wchar_t, putwchar() */
#include <iconv.h> /* iconv_t, iconv_open(), iconv(), iconv_close() */
#include <stdlib.h> /* malloc(), EXIT_SUCCESS */
int main(void) {
setlocale(LC_ALL, ""); // We initialize the locale
iconv_t converter = iconv_open("WCHAR_T", nl_langinfo(CODESET)); // We initialize a converter
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Football
Football
Rugby
Football
Cricket
Football
Tennis
Tennis
Cricket
Football