Skip to content

Instantly share code, notes, and snippets.

View dimapaloskin's full-sized avatar
:octocat:
>_

Dima Paloskin dimapaloskin

:octocat:
>_
View GitHub Profile
@dimapaloskin
dimapaloskin / gist:8644017
Last active January 4, 2016 15:59
For validator
<!DOCTYPE html>
<html>
<head>
<title>Test 2</title>
<meta charset="utf-8" />
<style>
.title {
text-align: center;
}
var js = document.createElement("script"); js.type = "text/javascript"; js.src = 'http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js';document.body.appendChild(js);
var style = document.createElement("style"); style.innerHTML = '#editor {position: absolute; top: 0; left: 400px; width: 100%; height: 80%;}'; document.body.appendChild(style);
var div = document.createElement("div"); div.setAttribute('id', 'editor'); document.body.appendChild(div);
setTimeout(function () {window.e = ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/html"); }, 1000);
function EditSite_SaveEditingText()
{
var js = document.createElement("script"); js.type = "text/javascript"; js.src = 'http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js';document.body.appendChild(js);
var js = document.createElement("script"); js.type = "text/javascript"; js.src = 'http://code.jquery.com/jquery-1.11.0.min.js';document.body.appendChild(js);
var style = document.createElement("style"); style.innerHTML = '#editor {position: absolute; top: 0; left: 400px; width: 100%; height: 80%;}'; document.body.appendChild(style);
var div = document.createElement("div"); div.setAttribute('id', 'editor'); document.body.appendChild(div);
setTimeout(function () {
window.e = ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/html");
var js = document.createElement("script"); js.type = "text/javascript"; js.src = 'http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js';document.body.appendChild(js);
var js = document.createElement("script"); js.type = "text/javascript"; js.src = 'http://code.jquery.com/jquery-1.11.0.min.js';document.body.appendChild(js);
var style = document.createElement("style"); style.innerHTML = '#editor {position: absolute; top: 0; left: 400px; width: 600px; height: 80%;}'; document.body.appendChild(style);
var div = document.createElement("div"); div.setAttribute('id', 'editor'); document.body.appendChild(div);
setTimeout(function () {
window.e = ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/html");
$(document).keydown(function(event) {
//19 for Mac Command+S
if (!( String.fromCharCode(event.which).toLowerCase() == 's' && event.ctrlKey) && !(event.which == 19)) return true;
EditSite_SaveEditingText();
event.preventDefault();
return false;
});
@dimapaloskin
dimapaloskin / gist:9151719
Created February 22, 2014 10:24
Ace-editor + CtrlS handler + opacity + text inserting
var js = document.createElement("script");
js.type = "text/javascript";
js.src = 'http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js';
document.body.appendChild(js);
var js = document.createElement("script");
js.type = "text/javascript";
js.src = 'http://code.jquery.com/jquery-1.11.0.min.js';
document.body.appendChild(js);
var js = document.createElement("script");
js.type = "text/javascript";
js.src = 'http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js';
document.body.appendChild(js);
var js = document.createElement("script");
js.type = "text/javascript";
js.src = 'http://code.jquery.com/jquery-1.11.0.min.js';
document.body.appendChild(js);
@dimapaloskin
dimapaloskin / gist:9188857
Created February 24, 2014 13:55
sidebar fake
<style>
html, body {
padding: 0;
margin: 0;
}
.work {
padding: 0;
margin: 0;
@dimapaloskin
dimapaloskin / 0_reuse_code.js
Created March 5, 2014 08:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dimapaloskin
dimapaloskin / rails_resources.md
Created March 5, 2014 08:47 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h