Skip to content

Instantly share code, notes, and snippets.

View ceee's full-sized avatar

tobi ceee

View GitHub Profile
@ceee
ceee / gist:5231417
Last active December 15, 2015 08:29
diagnostics CSS by Chris Coyier
/* Empty Elements */
div:empty, span:empty, li:empty, p:empty, td:empty, th:empty
{ padding: 20px; border: 5px dotted yellow !important; }
/* Empty Attributes */
*[alt=""], *[title=""], *[class=""], *[id=""], a[href=""], a[href="#"]
{ border: 5px solid yellow !important; }
/* Deprecated Elements */
applet, basefont, center, dir, font, isindex, menu, s, strike, u
@ceee
ceee / gist:5668841
Created May 29, 2013 08:39
holidays 2013-2015 in Austria as JSON
[
"01.01.2013",
"06.01.2013",
"29.03.2013",
"01.04.2013",
"01.05.2013",
"09.05.2013",
"20.05.2013",
"30.05.2013",
"15.08.2013",
@ceee
ceee / .gitignore
Created June 25, 2013 18:45
.gitignore for .NET
# =========================
# Project
# =========================
## Ignore Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
@ceee
ceee / gist:6033429
Created July 18, 2013 21:49
fetch meta attribute in vanilla js (with og support)
/**
* Fetches a meta (+ open graph) attribute from HTML
*
* @returns value The request content of the meta tag (nullable)
*/
var getMetaAttribute = function( attribute )
{
var key = null;
var value = null;
var meta = document.getElementsByTagName('meta');
@ceee
ceee / precision
Created July 26, 2013 11:41
Provides a Sass function, which rounds a number by the given precision
@function precision($value, $precision)
{
$base: 10;
$divisor: 1;
@for $i from 1 through $precision
{
$divisor: $divisor * $base;
}
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Windows.Foundation;
using Windows.Phone.Speech.Synthesis;
namespace Utilities
{
public class SpeechUtility : IDisposable
@ceee
ceee / MainViewModel.cs
Created January 13, 2014 21:08
Infinite scrolling or LongListSelector
// your items
public ObservableCollection<Item> Items { get; set; }
// your items per page
private int _bufferSize = 15;
// populate the Items member
public async Task UpdateLists(int page = 0)
{
@ceee
ceee / poki.txt
Created February 5, 2014 20:07
Bookmarklet "Add to Poki"
javascript:location.href='pocket:Add?Data='+encodeURIComponent('{"Items":[{"Uri":"'+location.href+'"}]}');
<phone:Panorama.TitleTemplate>
<DataTemplate>
<!-- You have to assign a width here as the Canvas has no impact on the layout, and therefore it won't stretch the Grid to match it's siblings width.
As the Grid has a calculated width of 0 in your code example, it will get repeated faster (which is visible to you). The problem with the TitleTemplate is, that you can't set HorizontalAlignment="Stretch" (for 100% width), as it won't work here :-S
If you increase the Width, the Logo will move faster, therefore you will get a faster parallax movement -->
<Grid Margin="0,34,0,0" Width="240" Height="134.218">
<!-- I have also removed the Canvas Background, as it won't work anymore with the added width. Just set a Background for the Panorama itself, this will get around this issue (Panorama.Background) -->
<Canvas x:Name="DivvyLogoBranding">
<Path Data="F1M0,0L0,73.195 25.669,0z"
Fill="#FF
@ceee
ceee / gist:7696667e10501a5a2ed1
Created May 19, 2014 08:17
loading control layout (Poki)
<Grid x:Name="LayoutRoot" Width="37" Height="42" Visibility="Collapsed" Opacity="0">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="DefaultState">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Visibility"
BeginTime="0:0:0.2">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity"