Skip to content

Instantly share code, notes, and snippets.

View Serrin's full-sized avatar

Ferenc Czigler Serrin

  • Budapest
View GitHub Profile
@Serrin
Serrin / markdown-details-collapsible.md
Created March 9, 2021 18:38 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@Serrin
Serrin / iife.js
Created March 5, 2021 20:45 — forked from jemgold/iife.js
IIFE
// Either of the following two patterns can be used to immediately invoke
// a function expression, utilizing the function's execution context to
// create "privacy."
(function(){ /* code */ }()); // Crockford recommends this one
(function(){ /* code */ })(); // But this one works just as well
// Because the point of the parens or coercing operators is to disambiguate
// between function expressions and function declarations, they can be
@Serrin
Serrin / punctuation.js
Created January 6, 2021 10:13 — forked from davidjrice/punctuation.js
List of punctuation characters
var PUNCTUATION = "" +
"’'" + // apostrophe
"()[]{}<>" + // brackets
":" + // colon
"," + // comma
"‒–—―" + // dashes
"…" + // ellipsis
"!" + // exclamation mark
"." + // full stop/period
"«»" + // guillemets
@Serrin
Serrin / baseConverter.js
Created December 15, 2020 21:06 — forked from faisalman/baseConverter.js
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <[email protected]>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
@Serrin
Serrin / offline_mdn_docs.md
Created December 2, 2020 08:47 — forked from zed-dz/offline_mdn_docs.md
Offline MDN Docs
@Serrin
Serrin / es6-import-cheat-sheet.md
Created November 29, 2020 15:41 — forked from samueljseay/es6-import-cheat-sheet.md
ES6 exports / imports cheat sheet
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
@Serrin
Serrin / html
Last active November 20, 2020 17:35 — forked from maxdenaro/html
HTML Email Template
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HTML Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body {
width: 100% !important;
@Serrin
Serrin / fetch.js
Created November 15, 2020 08:49 — forked from rockydd/fetch.js
// Example POST method implementation:
async function postData(url = '', data = {}) {
// Default options are marked with *
const response = await fetch(url, {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
headers: {
@Serrin
Serrin / linebreak.md
Created November 11, 2020 12:08
Line breaks in markdown
Hello  (<-- two spaces)
World

Hello
World


@Serrin
Serrin / javascript.translit.js
Created October 22, 2020 18:45 — forked from croisillon/javascript.translit.js
JavaScript translater russian to translit
function rus_to_latin ( str ) {
var ru = {
'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd',
'е': 'e', 'ё': 'e', 'ж': 'j', 'з': 'z', 'и': 'i',
'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o',
'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u',
'ф': 'f', 'х': 'h', 'ц': 'c', 'ч': 'ch', 'ш': 'sh',
'щ': 'shch', 'ы': 'y', 'э': 'e', 'ю': 'u', 'я': 'ya'
}, n_str = [];