Skip to content

Instantly share code, notes, and snippets.

View mkormendy's full-sized avatar
🛠️
Building, fixing, making a living

Mike Kormendy mkormendy

🛠️
Building, fixing, making a living
View GitHub Profile
tell application "System Events"
keystroke "s" using command down
end tell
tell application "Google Chrome" to tell the first «class CrTb» of its first window
«event CrSuRlod»
end tell
tell application "Google Chrome" to set «class acTI» of first window to 1
@mkormendy
mkormendy / Proper-Chevron.markdown
Created August 11, 2014 20:54
A Pen by Mike Kormendy.
@mkormendy
mkormendy / gradient-style.css
Created October 18, 2014 18:19
From http://stackoverflow.com/questions/3934693/gradients-in-internet-explorer-9 Here is a nice workaround solution using PHP to return an SVG (vertical linear) gradient instead, which allows us to keep our design in our stylesheets.
.my-color {
background-color: #f00;
background-image: url(gradient.php?from=f00&to=00f);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f00), to(#00f));
background-image: -webkit-linear-gradient(top, #f00, #00f);
background-image: -moz-linear-gradient(top, #f00, #00f);
background-image: linear-gradient(top, #f00, #00f);
}
@mkormendy
mkormendy / lastpostclass.php
Created October 19, 2014 22:38
Inserting a class onto the element of the last post of a Wordpress loop.
<?php /* The Loop */ ?>
<?php $post_counter = 0;
while ( have_posts() ) : the_post() ?>
<?php $post_counter++; ?>
<div id="post-<?php the_ID(); ?>" <?php if( $post_counter == count( $posts ) ) post_class('last-post'); else post_class(); ?>>
@mkormendy
mkormendy / gist:41f0d5298f2eaaa53a8d
Last active August 29, 2015 14:08
IE 10 11 Feature Detection
// modified from Tim Pietrusky: http://jsfiddle.net/evildonald/jLuF5/
var ie10PlusStyles = [
'msTouchAction',
'msWrapFlow',
'msWrapMargin',
'msWrapThrough',
'msOverflowStyle',
'msScrollChaining',
'msScrollLimit',
'msScrollLimitXMin',

Keyboard Activated Accessibility

This test example attempts to hide accessible styles until they are needed. We provide accessible outline focus styles only when the user uses keyboard input. When the mouse is activated or clicks a link it deactivates accessible styles.

A Pen by Mike Kormendy on CodePen.

License.

tell application "System Events"
-- get current clipboard contents as a string
set CurrentClipboard to the clipboard as string
-- set the clipboad to your password
set the clipboard to "Y0urVPNPa$$w0rd"
-- start playing with the VPN
tell current location of network preferences
@mkormendy
mkormendy / gulpfile.js
Last active August 29, 2015 14:10 — forked from barnaby/gulpfile.js
var gulp = require('gulp'),
takana = require('takana');
gulp.task('takana', function() {
takana.run({
path: __dirname,
includePaths: [] // Optional
});
});
@mkormendy
mkormendy / removehtmlcodes
Last active August 29, 2015 14:20
Regex to remove html tags and html encoded characters. From http://regexr.com/3au0j
/<[^>]*>|&.*?;/g
@mkormendy
mkormendy / gist:c9de299b997d084d59ba
Last active August 29, 2015 14:21
simple jQuery plugin to replace an element type
(function($) {
$.fn.changeElementType = function(newType) {
var attrs = {};
$.each(this[0].attributes, function(idx, attr) {
attrs[attr.nodeName] = attr.nodeValue;
});
this.replaceWith(function() {
return $("<" + newType + "/>", attrs).append($(this).contents());