Skip to content

Instantly share code, notes, and snippets.

View tmedwards's full-sized avatar

Thomas M. Edwards tmedwards

View GitHub Profile
@tmedwards
tmedwards / scroll-to-element-bottom.twee
Created January 2, 2018 00:24
Scrolls element(s), which are set to scroll, to the their bottoms.
:: Story JavaScript [script]
postdisplay['scroll-box'] = function (taskName) {
setTimeout(function () {
$('.scroll-box').each(function () {
var $this = $(this);
$this.scrollTop($this.prop('scrollHeight') - $this.height());
});
}, Engine.minDomActionDelay);
};
@tmedwards
tmedwards / sc-i18n-example.twee
Last active March 13, 2024 06:46
SugarCube v2 basic internationalization (i18n) example using the Settings menu (in Twee notation)
:: StoryTitle
SugarCube i18n example
:: Language Switching [script]
;(function () {
/***********************************************************
Set up a `i18n` object on SugarCube's `setup` object.
***********************************************************/
setup.i18n = {
@tmedwards
tmedwards / gist:885afc1a71fd0cace9d2
Last active August 29, 2015 14:26 — forked from alimbada/gist:3083937
Metro Style for WPF Button
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style
x:Key="ButtonFocusVisual">
<Setter
Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2" />
</ControlTemplate>