Skip to content

Instantly share code, notes, and snippets.

@kyranjamie
kyranjamie / js - calc input
Created May 10, 2012
jQuery - Calculate inputs
View js - calc input
var week = $('.week');
var month= $('.month');
var year = $('.year');
function weekCalc(sender, args) {
var value = sender.val();
var milesPerMonth = value * 4.35;
var milesPerYear = value * 52;
@kyranjamie
kyranjamie / gist:4988916
Last active Dec 13, 2015
ASP.NET - Remove www prefix with 301 redirect to root domain.
View gist:4988916
<rewrite>
<rules>
<rule name="Remove WWW prefix" >
<match url="(.*)" ignoreCase="true" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.domainname\.co.uk" />
</conditions>
<action type="Redirect" url="http://domainname.co.uk/{R:1}" redirectType="Permanent" />
</rule>
</rules>
@kyranjamie
kyranjamie / gist:5104476
Last active Dec 14, 2015
ASP.NET enable SVG images Azure, to be put in system.webServer.
View gist:5104476
<staticContent>
<remove fileExtension=".mp4"/>
<remove fileExtension=".ogv"/>
<remove fileExtension=".webm"/>
<remove fileExtension=".svg"/>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml"/>
</staticContent>
View Preferences.sublime-settings
{
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"dictionary": "Packages/Language - English/en_GB.dic",
"folder_exclude_patterns":
[
".sass-cache",
"node_modules",
".git"
],
View conf-swap-num-symbols
<item>
<name>Swap symbols for numbers</name>
<appendix></appendix>
<identifier>private.swap_nums</identifier>
<!-- 0 -->
<autogen>__KeyToKey__ KeyCode::KEY_0, ModifierFlag::NONE, KeyCode::KEY_0, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::KEY_0, ModifierFlag::NONE, KeyCode::KEY_0, ModifierFlag::SHIFT_R</autogen>
View gist:8396874
<item>
<name>Hold num key to symbol</name>
<appendix>Input symbol on hold of number key</appendix>
<identifier>private.num_change</identifier>
<autogen>__HoldingKeyToKey__
KeyCode::KEY_1,
KeyCode::KEY_1,
View colours.scss
@function black($opacity) {
@return rgba(0,0,0,$opacity);
};
@function white($opacity) {
@return rgba(255,255,255,$opacity);
};
View gist:9114032
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>daskeyboard</vendorname>
<vendorid>0x04d9</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>daskeyboard</productname>
<productid>0x2013</productid>
View gist:9780376
<?xml version="1.0"?>
<root>
<!--
# Declare hardware devices
-->
<devicevendordef>
<vendorname>daskeyboard</vendorname>
<vendorid>0x04d9</vendorid>
</devicevendordef>
View gist:1c48427caa121ca8a947
<?xml version="1.0"?>
<root>
<!--
# Declare hardware devices
-->
<devicevendordef>
<vendorname>daskeyboard</vendorname>
<vendorid>0x04d9</vendorid>
</devicevendordef>