Skip to content

Instantly share code, notes, and snippets.

@karlhorky
karlhorky / flash-autoupdate.bat
Created August 25, 2012 13:36
Trigger Adobe Flash Player Auto-Update mechanism on Windows
:: On-Demand Flash Autoupdate
:: Author: Karl Horky
:: Date: 22 June 2012
:: Version: 0.2
:: Homepage: http://www.karlhorky.com/2012/06/manually-run-autoupdate-for-adobe-flash.html
@echo off
cd C:\Windows\System32\Macromed\Flash\
if exist *ActiveX.exe (
echo Updating Flash Player Plugin for Internet Explorer
@karlhorky
karlhorky / grayscale-disable.css
Created August 26, 2012 12:17
Cross-Browser CSS Grayscale
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale");
-webkit-filter: grayscale(0%);
}
@karlhorky
karlhorky / components.scss
Last active October 9, 2015 10:57
CSS Components
// Moved to https://github.com/karlhorky/css-components
@karlhorky
karlhorky / css-priority-guide.scss
Created August 31, 2012 21:20
CSS Priority Guide
.component {
@include background(linear-gradient(top, #fff 0%, #ddd 100%)); /* Mixins */
border: none; /* Overriding boilerplate */
margin-top: 20px; /* Affecting layout in relation to previous elements */
background: red; /* Most important styles to visual appearance */
display: inline-block; /* ... to ... */
padding: 2px; /* Least important */
margin-bottom: 10px; /* Relevant to following components */
position: relative; /* Relevant to children */
border: 1px solid rgba(#000, .3); /* Relevant to IE override */
@karlhorky
karlhorky / Clock.ini
Created November 17, 2012 19:36
Rainmeter Simple Clock in German
;moved to https://github.com/karlhorky/windows-configfiles
@karlhorky
karlhorky / Microsoft.PowerShell_profile.ps1
Created November 17, 2012 19:50
PowerShell User Profile
# Moved to https://github.com/karlhorky/windows-configfiles
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text 3 if you're running Vintage or Vintageous
# (Vim) modes, as it means you cannot press and hold h/j/k/l to move through your file. You
# have to repeatedly press the keys to navigate.
@karlhorky
karlhorky / angular-throttle.coffee
Created April 4, 2014 09:36
throttle through an AngularJS service. based on https://gist.github.com/mrgamer/6139485
angular.module("app").factory "throttle", [
"$timeout"
($timeout) ->
return (delay, no_trailing, callback, debounce_mode) ->
timeout_id = undefined
last_exec = 0
if typeof no_trailing isnt "boolean"
debounce_mode = callback
callback = no_trailing
@karlhorky
karlhorky / .extra
Last active August 29, 2015 14:05
Add line disabling atomic_save if not found in Sublime Text preferences. Fixes ST3 with Vagrant + NFS http://serverfault.com/questions/534507/vagrant-nfs-share-doesnt-show-updated-file-if-size-doesnt-change
# Fixes Sublime Text 3 issue with Vagrant and NFS http://serverfault.com/questions/534507/vagrant-nfs-share-doesnt-show-updated-file-if-size-doesnt-change
SUBLIME_PREFS="$HOME/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings"
if ! grep -q atomic_save "$SUBLIME_PREFS"; then
perl -ni -e 'print;if ($.==1) {print " \"atomic_save\": false,\n"}' "$SUBLIME_PREFS"
fi
unset SUBLIME_PREFS
from selenium.common.exceptions import NoSuchElementException, TimeoutException
class DomHelper(object):
driver = None
waiter = None
def open_page(self, url):
self.driver.get(url)