Skip to content

Instantly share code, notes, and snippets.

View okonet's full-sized avatar

Andrey Okonetchnikov okonet

View GitHub Profile
#overlay {
position: absolute;
margin: auto;
top: 0; left: 0;
width: 100%; height: 100%;
z-index: 9999;
border: 0;
background-color: #000!important;
}
#overlay[id] { position: fixed; }
first = true
variations.each do |variation|
styleclass = "selected" if first
first = false
# Do stuff
end
var theEvent = document.createEvent('MouseEvents');
theEvent.initMouseEvent("click", true, true, document.defaultView, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null);
element.dispatchEvent(theEvent);
/* Shake effect */
@-webkit-keyframes shake {
0% {
-webkit-transform: translateX(0);
}
25% {
-webkit-transform: translateX(30px);
}
50% {
-webkit-transform: translateX(-20px);
@okonet
okonet / bbd4.css
Created November 30, 2010 16:25
Source code of my CSS3 beanie. For details and demo go to http://okonet.ru
/* Blue Beanie */
.with-blue-beanie .beanie {
position: absolute;
top: -25px;
left: 0px;
width: 64px;
height: 40px;
-webkit-border-top-left-radius: 40px;
@okonet
okonet / Guardfile
Created March 20, 2012 17:44
Example of a Guardfile
guard 'coffeescript', :input => 'app', :output => 'public/javascripts/app', :cli => ''
guard 'coffeescript', :input => 'spec/coffeescripts', :output => 'spec/javascripts'
guard 'compass' do
watch(/app\/stylesheets\/(.*)\.s[ac]ss/)
end
spec_location = "spec/coffeescripts/%s_spec"
guard 'jasmine-headless-webkit' do
watch(%r{^spec/coffeescripts/(.*)_spec\..*}) { |m| newest_js_file(spec_location % m[1]) }
@okonet
okonet / gist:3436156
Created August 23, 2012 12:18
MouseEvent
theEvent = document.createEvent('MouseEvents')
theEvent.initEvent("click", true, true, e.view, 1, e.changedTouches[0].screenX, e.changedTouches[0].screenY, e.changedTouches[0].clientX, e.changedTouches[0].clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,0, null)
@theTarget.dispatchEvent theEvent
@theTarget = null
@okonet
okonet / Cakefile
Created August 28, 2012 09:50
SVG post-processing
fs = require 'fs'
path = require 'path'
ensureDir = require 'ensureDir'
jsdom = require 'jsdom'
phantom = require 'phantom'
{exec} = require 'child_process'
# ANSI Terminal Colors.
# bold = '\033[0;1m'
# red = '\033[0;31m'
@okonet
okonet / model.js
Last active December 19, 2015 18:49
Backbone.Model.destroy method workaround for jQuery 1.9+
model.destroy({
wait: true,
dataType: 'text', // Set this to `text`
success: function() {
// will be called even if server returns empty string,
// which is normal behavior for DELETE requests
// See #2218 (https://github.com/jashkenas/backbone/issues/2218) for details
}
});
"use strict"
module.exports = (grunt) ->
require("matchdep").filterAll("grunt-*").forEach grunt.loadNpmTasks
grunt.initConfig
bower:
install: