Skip to content

Instantly share code, notes, and snippets.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:bc="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35">
<Style x:Key="Ñ">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeThickness="1" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeDashArray="1 2" SnapsToDevicePixels="True" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
//*********************************************************//
// Copyright (c) Microsoft. All rights reserved.
//
// Apache 2.0 License
//
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@contee213
contee213 / producer.py
Created January 29, 2015 11:24
asyncio producer consumer sample
# -*- coding: utf-8 -*-
__author__ = 'contee'
"""
asyncio producer-consumer
~~~~~~~~~~~~~~
"""
import asyncio, random
def log(f):
def wrapper():
try:
print("in")
return f()
finally:
print("out")
return wrapper
def logvar(text):
@contee213
contee213 / multilize.py
Created September 5, 2014 08:46
dive to python - functions
patterns = (
('[sxz]$', '$', 'es'),
('[^aeioudgkprt]h$', '$', 'es'),
('[^aeiou]y$', 'y$', 'ies'),
('$', '$', 's')
)
def mls(pattern, remove, replace):
def match(word):
return re.search(pattern, word)
@contee213
contee213 / counter.py
Created September 2, 2014 08:07
nonlocal test
def make_counter(init):
i = init
def count():
nonlocal i
i = i + 1
print(i)
return count
if __name__ == '__main__':
@contee213
contee213 / SampleController.java
Created July 12, 2014 22:49
Spring Boot Sample
package net.contee.sample.hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* Created by contee on 2014/07/13.
@contee213
contee213 / hello.kt
Created July 4, 2014 08:41
kotlin hello world
/**
* Created by contee on 2014/07/04.
*/
fun main(args : Array<String>) {
println("Hello, world!")
}
@contee213
contee213 / HelloTwitter.java
Created July 2, 2014 12:02
twitter basics
import twitter4j.*;
/**
* Created by contee on 2014/07/02.
*/
public class HelloTwitter {
public static void main(String[] args) throws TwitterException {
Twitter twitter = TwitterFactory.getSingleton();
ResponseList<Status> homeTimeLine = twitter.getHomeTimeline();
gist-vimからの投稿テスト