Skip to content

Instantly share code, notes, and snippets.

@Zmetser
Zmetser / blinkingAnimation.js
Created December 12, 2011 14:15
Do blink animation with ext.js
function blinkingAnimation(evt, el, o) {
var target = Ext.get(o.element || el);
var blink = {
run: function () {
target.fadeOut(100);
target.fadeIn(100);
},
interval: 200,
repeat: o.repeat || 10
@Zmetser
Zmetser / checkbox_align.html
Created November 26, 2012 12:07
How to align checkboxes and their labels consistently cross browsers
<form>
<div>
<label><input type="checkbox" /> Label text</label>
</div>
<div>
<label><input type="checkbox" /> http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers</label>
</div>
</form>
<style type="text/css">
@Zmetser
Zmetser / redactor_buttons.js
Last active December 14, 2015 06:29
Very basic superscript and subscript buttons for Redactor 9.
RedactorPlugins.supersub = {
init: function () {
this.buttonAdd('superscript', 'Superscript', this.executeSuperscript);
this.buttonAdd('subscript', 'Subscript', this.executeSubscript);
},
executeSuperscript: function () {
this.execCommand('superscript');
},
@Zmetser
Zmetser / gist:5300974
Created April 3, 2013 12:55
Default (OSX).sublime-keymap * Reveal in side bar * Reveal in finder
{
"keys": ["super+shift+r"],
"command": "reveal_in_side_bar"
},
{
"keys": ["super+f", "super+i"],
"command": "open_dir",
"args": {"dir": "$file_path", "file": "$file_name"}
}
{
"predef":[
"_"
],
"bitwise" : true,
"camelcase" : false,
"curly": false,
"eqeqeq": true,
"forin": true,
@Zmetser
Zmetser / jquery.foundation.dropdownhover.js
Created January 7, 2014 15:25
Dropdown plugin for foundation with hover functionality only.
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.dropdownhover = $.extend({}, Foundation.libs.dropdown, {
name : 'dropdownhover',
version : '1.0.0',
init: function (scope, method, options) {
Foundation.inherit(this, 'throttle');
@Zmetser
Zmetser / youtubeID.js
Last active August 29, 2015 13:56 — forked from takien/youtubeID.js
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
function normalizeUrl(url) {
var protocol;
url = encodeURI(url);
protocol = url.match(/^https?/);
url = url.replace(/\/$/, '');
url = url.replace(/^https?:\/\//, '');
url = url.replace(/^www./, '');
url = (protocol ? protocol[0] : 'http') + '://www.' + url;
return url;
}
https?:\/\/ // Required scheme. Either http or https.
(?:[a-z0-9-]+\.)? // Optional subdomain.
vimeo\.com\/ // Domain name.
(?: // Group path alternatives.
moogaloop.swf\?clip_id= // Either moogaloop.swf?clip_id=
|video\/ // or video/
)? // or nothing. End path alternatives.
(?:
channels\/ // channels/channel_name/
[^\/]+\/
@Zmetser
Zmetser / gist:9716433
Created March 23, 2014 00:16
Synced folder setting in Vagrantfile with proper rights
data['vm']['synced_folder'].each do |i, folder|
if folder['source'] != '' && folder['target'] != '' && folder['id'] != ''
nfs = (folder['nfs'] == "true") ? "nfs" : nil
config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{folder['id']}", type: nfs,
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775", "fmode=664"]
end
end