Skip to content

Instantly share code, notes, and snippets.

View in4lio's full-sized avatar
:octocat:
(눈‸눈)

Vitaly Kravtsov in4lio

:octocat:
(눈‸눈)
  • Karlsruhe, Germany
View GitHub Profile
@in4lio
in4lio / hn_search.js
Last active September 19, 2023 06:56 — forked from meiamsome/hn_search.js
hn job query search
// Takes arguments and produces an array of functions that accept context.
function handle_args() {
var args = Array.prototype.slice.call(arguments);
return args.map(function(arg) {
if (arg instanceof Function) return arg; // Presumably already a contex-accepting function.
if (arg instanceof Array) return and.apply(this, arg); // Make arrays behave as and.
// Presuming a string, build a function to check.
var my_regex = new RegExp(arg.toString(), 'i');
return function(context) {
return context.search(my_regex) > -1;
@in4lio
in4lio / vCard_S30.py
Last active April 17, 2024 22:18
Сonvert vCards into suitable for Nokia Series 30+ format
r"""
vCard_S30.py -- Convert vCards into suitable for Nokia Series 30+ format, or
How to solve the only one phone number per contact problem.
1) Import contacts "contacts.vcf" from Google account (vCard format).
2) Place it beside this script.
3) Run the script with Python 2.7.
4) Copy the result "backup.dat" into "Backup" folder on the phone SD card.
5) Restore contacts from backup on the phone.
@in4lio
in4lio / stepic.org testing scripts
Last active July 30, 2017 17:07
Testing solutions of stepic.org programming assignments
Please read StepicTest.md carefully)
@in4lio
in4lio / coroutine.h
Last active May 7, 2021 02:51
Coroutines in C
/**
* \file coroutine.h
* \brief Coroutines in C.
* \author Vitaly Kravtsov (in4lio@gmail.com)
* \copyright The MIT License
*
* Coroutine mechanics, implemented using the C language extension "Labels as Values".
* Based on Simon Tatham "Coroutines in C".
*/
@in4lio
in4lio / binary.h
Last active August 29, 2015 13:56
Definition of binary numbers
/**
* \file binary.h (generated by binary_h.pl)
* \brief Definition of binary numbers.
* \code
* B010, B01010111, B8( 1000111 ) --> 2, 87, 71
* B16( 1, 11000011 ) --> 451
* B32( 0, 11000000, 11111111, 11101110 ) --> 12648430
* \endcode
*/
@in4lio
in4lio / unfold.h
Last active October 21, 2016 15:46
Unfolding of C macros
/**
* \file unfold.h (generated by unfold_h.py)
* \brief Unfolding of C macros (up to 255).
* \code
* UNFOLD( 3, T0, T, arg1, arg2 ) --> T0( 0, arg1, arg2 ) T( 1, arg1, arg2 ) T( 2, arg1, arg2 )
* UNFOLD_FROM( 10, 3, T0, T, arg1, arg2 ) --> T0( 10, arg1, arg2 ) T( 11, arg1, arg2 ) T( 12, arg1, arg2 )
* \endcode
* In case of `UNFOLD_FROM`, you must use `__concat_X` in macros (`T`) to concatenate index (`N`), for example:
* \code
* #define T0( N ) BIT_##N