Skip to content

Instantly share code, notes, and snippets.

View Murmurianez's full-sized avatar

Aleksey Andreev Murmurianez

  • Russia, Saint-Petersburg
View GitHub Profile
@Murmurianez
Murmurianez / Node.js CORS
Created September 14, 2017 18:12 — forked from nilcolor/Node.js CORS
Node.js cross-origin POST. You should response for OPTIONS request first. Something like this.
if (req.method === 'OPTIONS') {
console.log('!OPTIONS');
var headers = {};
// IE8 does not allow domains to be specified, just the *
// headers["Access-Control-Allow-Origin"] = req.headers.origin;
headers["Access-Control-Allow-Origin"] = "*";
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS";
headers["Access-Control-Allow-Credentials"] = false;
headers["Access-Control-Max-Age"] = '86400'; // 24 hours
headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept";
@Murmurianez
Murmurianez / index.html
Last active July 29, 2021 11:03
Simple CSS + SVG checkbox and radiobox
<style>
.checkbox{
margin: 10px 20px;
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label{
border: 2px solid #FFFFFF;
@Murmurianez
Murmurianez / gist:23f22ca3c3890529fb9f
Last active August 29, 2015 14:13
Set cursor position at end of input
$('[type="text"]').focus(function(){
var element = $(this)[0];
if (this.setSelectionRange) {
var len = $(this).val().length * 2;
element.setSelectionRange(len, len);
}else {
$(this).val($(this).val());
$(this).focus();
}
element.scrollTop = 9999;
.tab{float:left; width:32px; height:32px; background:#FFFFFF;}
.tab:hover{background:#F7F7F7;}
.tab.active{background:#01A1DC; color:#FFFFFF;}
.tab-content{display:none; float:left; width:300px; height:200px; background:#FFFFFF; border:1px solid #d8d5d6;}
.tab-content.active{display:block;}
@Murmurianez
Murmurianez / jsbin.eKacunu.css
Created January 17, 2014 11:14 — forked from anonymous/jsbin.eKacunu.css
Трёхколоночная, трёхстрочная таблица под размер окна.
html, body{
height: 100%;
margin: 0;
}
.table{
height: 100%;
position: relative;
background: green;
margin-bottom: -65px;
This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/).
Note that there is also a [Cheatsheet specific to Markdown Here](./Markdown-Here-Cheatsheet) if that's what you're looking for.
You can play around with Markdown on our [live demo page](http://www.markdown-here.com/livedemo.html).
##### Table of Contents
[Headers](#headers)
[Emphasis](#emphasis)
[Lists](#lists)
.lavaLamp {
position: relative;
height: 29px; width: 421px;
padding: 15px; margin: 10px 0;
overflow: hidden;
}
/* Force the list to flow horizontally */
.lavaLamp li {
float: left;
list-style: none;