Skip to content

Instantly share code, notes, and snippets.

View petrosh's full-sized avatar

Alex Petrosh petrosh

View GitHub Profile
@petrosh
petrosh / markdown.md
Created December 12, 2016 14:31 — forked from jonschlinkert/markdown-cheatsheet.md
A better markdown cheatsheet. I used Bootstrap's Base CSS documentation as a reference.

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading
@petrosh
petrosh / index.html
Created December 11, 2016 12:08
Web Worker
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Web Workers</title>
<script type="text/javascript">
if (window.Worker) {
var myWorker = new Worker("my_task.js");
myWorker.onmessage = function (oEvent) {
@petrosh
petrosh / practice.csv
Created December 3, 2016 14:50
ashtanga new year
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
date
2016-01-07
2016-01-12
2016-01-15
2016-01-19
2016-01-23
2016-01-26
2016-01-29
2016-02-01
2016-02-04
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@petrosh
petrosh / helper.js
Last active August 23, 2016 10:43
Michael style
Element.prototype.acc = function (ele, inner, attributes) {
var out = false;
if (ele.constructor === String) {
var element = document.createElement(ele);
if (inner !== '') {
element.innerHTML = inner;
}
if (attributes && attributes.constructor === Object) {
for (var key in attributes) {
if (attributes.hasOwnProperty(key)) {
//var p = document.createElement('p');
//p.innerHTML = 'ciao';
//document.body.appendChild(p);
document.body.innerHTML = "Hello World!";
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>dt-domtool</title>
<style media="screen">
body.red { background-color: red; }
</style>
<script src="querySelector.polyfill.js"></script>
<script src="script.js"></script>
@petrosh
petrosh / index.html
Last active July 3, 2016 13:00
polyfill querySelector
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>dt-domtool</title>
<style media="screen">
body.red { background-color: red; }
</style>
<script src="querySelector.polyfill.js"></script>
</head>
@petrosh
petrosh / index.html
Last active October 19, 2022 20:03 — forked from chrisallick/Base64 JS Demo
Base64 in JavaScript turn a json object to a base64 string. boom!
<!DOCTYPE html>
<html>
<head>
<title>Base64 Demo</title>
<meta charset="utf-8">
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js' type='text/javascript'></script>
<script src='https://javascriptbase64.googlecode.com/files/base64.js' type='text/javascript'></script>
W3sidGl0bGUiOiJNZXJpY2Egw6wiLCJzbHVnIjoiMDE0NjY1Zjc4NDc4YTU1MzM5Y2ZkOWI2NDQ1NjZkMzVkNDlmZTBiYSIsInJ1bm5pbmciOmZhbHNlfV0=
GET