Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Linq;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
namespace LinqToVisualTree
{
/// <summary>
/// Adapts a DependencyObject to provide methods required for generate
@gjulianm
gjulianm / WP8PullToRefreshDetector.cs
Last active December 15, 2015 09:29
Some things weren't used. This needs a thorough review.
using Microsoft.Phone.Controls;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
namespace Ocell.Controls
@messense
messense / proxy.pac
Last active December 17, 2015 09:39
pac file
/**
* GenPAC 0.2.1 http://jeeker.net/projects/genpac/
* Generated: Fri, 17 May 2013 14:15:55 GMT
* GFWList Last-Modified: Fri, 17 May 2013 12:41:31 GMT
*/
// proxy
var P = "PROXY 192.168.1.1:8118; DIRECT";
// user rules
@wangwen1220
wangwen1220 / js-toggledisabled-input.js
Last active December 14, 2016 08:35
JS: jQuery 切换启用和禁用 | toggle disabled input
// jQuery 切换启用和禁用表单项
(function ($) {
$.fn.toggleDisabled = function() {
return this.each(function() {
var $this = $(this);
if ($this.attr('disabled')) $this.removeAttr('disabled');
else $this.attr('disabled', 'disabled');
});
};
})(jQuery);
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
@Nilzor
Nilzor / statehelper.cs
Created November 15, 2012 13:04
StateHelper
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GalaSoft.MvvmLight.Messaging;
using GTWin8.Messages;
using GTWin8.Ui;
using Windows.UI.Xaml;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Caliburn.Micro;
using Autofac;
using IContainer = Autofac.IContainer;
namespace Caliburn.Micro.Autofac {
@chuquus
chuquus / README.md
Last active July 10, 2017 11:22
自用shadowsocks
@corydeppen
corydeppen / gist:3518666
Created August 29, 2012 20:42
Enable cross-domain Ajax requests using web.config
<system.webServer>
<httpProtocol>
<customHeaders>
<!--
Allow Web API to be called from a different domain.
http://dlr2008.wordpress.com/2012/04/26/asp-net-web-api-cross-domain-ajax-and-server-techniques-jsonp-and-cors/
-->
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
@Saanch
Saanch / StructureMapJobFactory.cs
Last active December 6, 2018 11:27
StructureMapJobFactory Quartz.net IoC using StructureMap
public class StructureMapJobFactory : IJobFactory
{
private static readonly ILog Logger = LogProvider.GetCurrentClassLogger();
private readonly IContainer _container;
public StructureMapJobFactory(IContainer container)
{
this._container = container;
}