Skip to content

Instantly share code, notes, and snippets.

View jozsefDevs's full-sized avatar
🏠
Working from home

jozsefDevs

🏠
Working from home
  • Budapest / Hungary
View GitHub Profile
@jozsefDevs
jozsefDevs / image-combine.js
Last active February 11, 2022 10:17
Have a nicer interface over ImageMagick to easily combine images horizontally/vertically from command line
/**
* Prerequsite to run this script:
* - ImageMagick installed
* - Node (>= 12LTS)
*
* Save this somewhere on your machine as a node script (my choice is usually ~/bin/node_scripts)
*
* After alias it in zshrc as:
* alias image_combine="node ~/node_scripts/image-combine.js"
*
@jozsefDevs
jozsefDevs / testUtils.tsx
Last active March 6, 2022 07:18
[TypeScript] Set up React Testing Library with Redux Toolkit + Routing
// ---------------------------------
// USING
// ---------------------------------
// "@reduxjs/toolkit": "1.5.0",
// "@testing-library/react": "11.2.5",
// "typescript": "3.7.2"
// "react": "16.13.1"
// "react-redux": "7.2.0",
// "react-router-dom": "5.2.0",
@jozsefDevs
jozsefDevs / bitwise_uppercase
Created October 22, 2013 20:21
Implementing toUpperCase() by Bitwise programming
#include <iostream>
using namespace std;
int main(){
char bitwiseMask = 0xdf, lowCase = 'a';
char upperCase = (char)(lowCase & bitwiseMask);
cout << upperCase << endl;
@jozsefDevs
jozsefDevs / validation_curry.js
Created October 22, 2013 20:17
A simple way to implement a validation by JavaScript currying
var above = function(limit){
return function(value){
return value > limit;
};
};
var isAbove10 = above(10);
console.log(isAbove10(5)); // false
console.log(isAbove10(8)); // false