Skip to content

Instantly share code, notes, and snippets.

View tmrk's full-sized avatar

Tamas Marki tmrk

  • Welthungerhilfe
  • Malmö, Sweden
  • 07:00 (UTC +02:00)
  • X @tmarki
  • LinkedIn in/tmarki
View GitHub Profile
@tmrk
tmrk / sweden-brand-colours.css
Created June 13, 2022 12:09
Sweden Brand Colours as Sass and CSS variables. Source: https://identity.sweden.se/en/design-elements/colour - originally developed by @deBroome
/* Sweden Brand Colours (CSS variables) */
/* Source: https://identity.sweden.se/en/design-elements/colour */
:root {
/* Primary colours */
--yellow: rgb(254, 203, 0);
--blue: rgb(0, 82, 147);
/* Secondary colours A */
--dawn-blue: rgb(26, 48, 80);
@tmrk
tmrk / n.js
Created June 7, 2022 08:51
Simple HTML node creator in JavaScript
// Node creator, usage: n('tag#id.class|attribute=value', text/[children], {event: function() {...})
const n = (tag, content, listener) => {
let el = document.createElement(tag.split('#')[0].split('.')[0].split('|').shift() || 'div');
if (tag.split('#')[1]) el.id = tag.split('#')[1].split('.')[0].split('|')[0];
if (tag.split('.')[1]) el.classList.add(...tag.split('.').slice(1).join('.').split('|')[0].split('.'));
if (tag.split('|')[1]) {
let attrTemp = tag.split('|').slice(1);
for (let i = 0; i < attrTemp.length; i++) el.setAttribute(attrTemp[i].split('=')[0], attrTemp[i].split('=')[1]);
}
if (content) {
@tmrk
tmrk / countries.json
Last active June 22, 2022 12:09
An array of all countries with ISO 3166-1 alpha-2, alpha-3 and M49 numeric country codes, as well the numeric codes for sub-regions, regions and intermediate regions as specified by the United Nations Statistics Division at https://unstats.un.org/unsd/methodology/m49/ (Updated: June 2022).
[
{ "name": "Afghanistan", "nameFrench": "Afghanistan", "nameSpanish": "Afganistán", "nameRussian": "Афганистан", "nameChinese": "阿富汗", "nameArabic": "أفغانستان", "m49code": 4, "region": 142, "subRegion": 34, "alpha2": "AF", "alpha3": "AFG", "LDC": true, "LLDC": true, "phoneCode": ["+93"] },
{ "name": "Åland Islands", "nameFrench": "Îles d’Åland", "nameSpanish": "Islas Åland", "nameRussian": "Аландских островов", "nameChinese": "奥兰群岛", "nameArabic": "جزر ألاند", "m49code": 248, "region": 150, "subRegion": 154, "alpha2": "AX", "alpha3": "ALA", "phoneCode": ["+35818"] },
{ "name": "Albania", "nameFrench": "Albanie", "nameSpanish": "Albania", "nameRussian": "Албания", "nameChinese": "阿尔巴尼亚", "nameArabic": "ألبانيا", "m49code": 8, "region": 150, "subRegion": 39, "alpha2": "AL", "alpha3": "ALB", "phoneCode": ["+355"] },
{ "name": "Algeria", "nameFrench": "Algérie", "nameSpanish": "Argelia", "nameRussian": "Алжир", "nameChinese": "阿尔及利亚", "nameArabic": "الجزائر", "m49code": 12, "region": 2, "subRegion": 15, "alp

Keybase proof

I hereby claim:

  • I am tmrk on github.
  • I am tmarki (https://keybase.io/tmarki) on keybase.
  • I have a public key ASD3Iln91qXkJZ_6iMENiv9FaTf5Upm6j1Zq82w_4BN0-wo

To claim this, I am signing this object:

@tmrk
tmrk / countries.js
Last active May 13, 2022 08:34
An array of all countries with ISO 3166-1 alpha-2, alpha-3 and numeric country codes, as well the numeric codes for sub-regions, regions and continents as specified by the United Nations Statistics Division at http://unstats.un.org/unsd/methods/m49/m49.htm (Updated May 2022).
var countries = [
{ 'name' : 'Afghanistan', 'alpha2' : 'AF', 'alpha3' : 'AFG', 'num3' : '004', 'subregion' : '034', 'region' : '', 'continent' : '142' },
{ 'name' : 'Åland Islands', 'alpha2' : 'AX', 'alpha3' : 'ALA', 'num3' : '248', 'subregion' : '154', 'region' : '', 'continent' : '150' },
{ 'name' : 'Albania', 'alpha2' : 'AL', 'alpha3' : 'ALB', 'num3' : '008', 'subregion' : '039', 'region' : '', 'continent' : '150' },
{ 'name' : 'Algeria', 'alpha2' : 'DZ', 'alpha3' : 'DZA', 'num3' : '012', 'subregion' : '015', 'region' : '', 'continent' : '002' },
{ 'name' : 'American Samoa', 'alpha2' : 'AS', 'alpha3' : 'ASM', 'num3' : '016', 'subregion' : '061', 'region' : '', 'continent' : '009' },
{ 'name' : 'Andorra', 'alpha2' : 'AD', 'alpha3' : 'AND', 'num3' : '020', 'subregion' : '039', 'region' : '', 'continent' : '150' },
{ 'name' : 'Angola', 'alpha2' : 'AO', 'alpha3' : 'AGO', 'num3' : '024', 'subregion' : '017', 'region' : '', 'continent' : '002' },
{ 'name' : 'Anguilla', 'alpha2' : 'AI', 'alpha3' : 'AIA', 'num3' :