Skip to content

Instantly share code, notes, and snippets.

Avatar

centurianii centurianii

  • JIT/Sofia
  • Bulgaria
View GitHub Profile
@centurianii
centurianii / CodeMirror.5.36.0.copy.cut.js
Last active Sep 27, 2018
Patch CodeMirror to trigger custom events on copy/cut to be used with a local buffer
View CodeMirror.5.36.0.copy.cut.js
// there are 2 patches, also see: https://github.com/codemirror/CodeMirror/issues/5594
// line 8703
function onCopyCut(e) {
if (signalDOMEvent(cm, e)) { return }
if (cm.somethingSelected()) {
setLastCopied({lineWise: false, text: cm.getSelections()})
if (e.type == "cut") { cm.replaceSelection("", null, "cut") }
} else if (!cm.options.lineWiseCopyCut) {
return
} else {
@centurianii
centurianii / buffer.js
Last active Sep 25, 2018
A global buffer (proposed for CodeMirror visual cut/copy/paste)
View buffer.js
/**
* @summmary
* window.utils
* ------------
* @desc
* A global object with utility functions.
* @var {Object} window.utils
*/
window.utils = window.utils || {};
View buttons_n_entities.css
/**
* Buttons & entities
*/
.button
{
display: inline-block;
white-space: nowrap;
background-color: #ccc;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#ccc));
background-image: -webkit-linear-gradient(top, #eee, #ccc);
@centurianii
centurianii / login_form.css
Last active Jan 3, 2016
The firsLogin form
View login_form.css
/**
* Login form
*/
html, body {
height: 100%;
}
body {
background-color: #D9DEE2;
background-image: -moz-linear-gradient(center top , #EBEEF2, #D9DEE2);
font: 12px 'Lucida Sans Unicode','Trebuchet MS',Arial,Helvetica;
View progress_bar.css
/**
* Progress bar
*/
.progress-bar {
background-color: #1a1a1a;
height: 25px;
padding: 5px;
width: 350px;
margin: 50px 0;
-moz-border-radius: 5px;
@centurianii
centurianii / pricing_table.css
Last active Jan 3, 2016
The first commented line is your dabblet’s title
View pricing_table.css
/**
* The first commented line is your dabblet’s title
*/
#pricing-table {
margin: 50px auto;
text-align: center;
width: 892px; /* total computed width = 222 x 3 + 226 */
}
#pricing-table .plan {
View breadcrumbs.css
/**
* Breadcrumbs
*/
ul{
margin: 0;
padding: 0;
list-style: none;
}
/* First */
View tucked_corners.css
/**
* Tucked corners
*/
.tucked-corners-top {
position: relative;
width: 500px; min-height: 200px;
margin: 50px auto; padding: 20px;
background-color: #cccccc; /* Fallback */
background: linear-gradient(45deg, transparent 10px, #cccccc 10px),
linear-gradient(135deg, transparent 10px, #cccccc 10px),
View button_bckgnds.css
/**
* Button backgrounds
*/
.boxes {
list-style: none outside none;
margin: 10px auto;
overflow: hidden;
padding: 0px;
width: 300px;
View sticker_shadow.css
/**
* Sticker shadow
*/
body:before
{
content: "";
position: fixed;
top: -10px;
left: 0;
width: 100%;