Skip to content

Instantly share code, notes, and snippets.

View kostasx's full-sized avatar
💭
Uncaught ReferenceError

Kostas Minaidis kostasx

💭
Uncaught ReferenceError
View GitHub Profile
@kostasx
kostasx / gist:4511e2b57394f3cf2a404a7f4304e790
Last active December 13, 2023 11:51
Cohort0x02-13.12.2023
<section data-background-transition='zoom' data-transition='concave' data-background='http://ryanjarvinen.com/presentations/shared/img/broadcast_reveal_dark.png' data-state='blackout'>
<h2>Gist-Powered</h2>
<h1>Reveal.js</h1>
<h2>Slideshow Presentations</h2>
<br/>
<h1 class='fragment grow'><a style='color:deepskyblue;' href='http://gist-reveal.it'>gist-reveal.it</a></h1>
</section>
<section data-markdown>
<textarea data-template>
## Welcome!
@kostasx
kostasx / git_submodules.md
Created December 1, 2023 11:15 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@kostasx
kostasx / linux_bash.md
Created July 21, 2023 19:05 — forked from ldong/linux_bash.md
linux and bash notes I took on LFS101x from EDX LinuxFoundationX

Linux and Bash

Lets talk about Linux and Bash.

Notes

Notes were taken from edx.org of LFS101x Introduction to Linux.

Date: Sun Sep 28 00:30:48 EDT 2014

@kostasx
kostasx / remove-node-modules.md
Created June 19, 2023 14:41 — forked from lmcneel/remove-node-modules.md
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a
@kostasx
kostasx / slim-redux.js
Created May 5, 2023 09:30 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@kostasx
kostasx / redux-light-example.js
Created January 11, 2023 08:32 — forked from bloodyowl/redux-light-example.js
redux in 14 lines of code
const store = createStore((state = { counter: 0 }, action) => {
switch(action.type) {
case "INCREMENT":
return { counter: state.counter + 1 }
case "DECREMENT":
return { counter: state.counter - 1 }
default:
return state
}
})
@kostasx
kostasx / Greek_to_slug.js
Last active December 16, 2022 09:03
Convert greek strings to URL slugs in JavaScript.
function string_to_slug(str) {
str = str.replace(/^\s+|\s+$/g, '') // TRIM WHITESPACE AT BOTH ENDS.
.toLowerCase(); // CONVERT TO LOWERCASE
const from = [ "ου", "ΟΥ", "Ού", "ού", "αυ", "ΑΥ", "Αύ", "αύ", "ευ", "ΕΥ", "Εύ", "εύ", "α", "Α", "ά", "Ά", "β", "Β", "γ", "Γ", "δ", "Δ", "ε", "Ε", "έ", "Έ", "ζ", "Ζ", "η", "Η", "ή", "Ή", "θ", "Θ", "ι", "Ι", "ί", "Ί", "ϊ", "ΐ", "Ϊ", "κ", "Κ", "λ", "Λ", "μ", "Μ", "ν", "Ν", "ξ", "Ξ", "ο", "Ο", "ό", "Ό", "π", "Π", "ρ", "Ρ", "σ", "Σ", "ς", "τ", "Τ", "υ", "Υ", "ύ", "Ύ", "ϋ", "ΰ", "Ϋ", "φ", "Φ", "χ", "Χ", "ψ", "Ψ", "ω", "Ω", "ώ", "Ώ" ];
const to = [ "ou", "ou", "ou", "ou", "au", "au", "au", "au", "eu", "eu", "eu", "eu", "a", "a", "a", "a", "b", "b", "g", "g", "d", "d", "e", "e", "e", "e", "z", "z", "i", "i", "i", "i", "th", "th", "i", "i", "i", "i", "i", "i", "i", "k", "k", "l", "l", "m", "m", "n", "n", "ks", "ks", "o", "o", "o", "o", "p", "p", "r", "r", "s", "s", "s", "t", "t", "y", "y", "y", "y", "y", "y", "y", "f", "f", "x", "x", "ps", "ps", "o",
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua and Barbuda
Argentina
Armenia
Australia
Austria
@kostasx
kostasx / eu_members.json
Last active November 21, 2022 11:12 — forked from PoeHaH/gist:ab9d8ac1b4ddee168d4d96c71797df31
JSON representation of EU countries, 2 letter codes
[
{ "country": "Austria", "code": "AT" },
{ "country": "Belgium", "code": "BE" },
{ "country": "Bulgaria", "code": "BG" },
{ "country": "Croatia", "code": "HR" },
{ "country": "Cyprus", "code": "CY" },
{ "country": "Czech Republic", "code": "CZ" },
{ "country": "Denmark", "code": "DK" },
{ "country": "Estonia", "code": "EE" },
{ "country": "Finland", "code": "FI" },