Skip to content

Instantly share code, notes, and snippets.

@itsff
itsff / boom
Created March 27, 2012 19:43
Test
This is a test of public gist
kjghlkjh
sdaflkjhlk
likhsadfkhj
dsfalkhdsaf
@itsff
itsff / windows.ui.xaml.markup.h
Created June 4, 2012 15:57
WinRT header file
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0594 */
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
@itsff
itsff / message types
Created July 10, 2012 17:44
Sample message types
<messages>
<message name="AccountListRequest" msgcat="app" msgtype="123456">
<field name="AccountListRequestID" required="Y" />
</message>
<message name="AccountListResponse" msgcat="app" msgtype="123457">
<field name="AccountListRequestID" required="Y" />
<component name="AccountData" repeats="Y" />
</message>
@itsff
itsff / message types.xml
Created July 10, 2012 17:45
Sample message types
<messages>
<message name="AccountListRequest" msgcat="app" msgtype="123456">
<field name="AccountListRequestID" required="Y" />
</message>
<message name="AccountListResponse" msgcat="app" msgtype="123457">
<field name="AccountListRequestID" required="Y" />
<component name="AccountData" repeats="Y" />
</message>
@itsff
itsff / TaskHelpers.cs
Created January 31, 2013 07:30
Extensions for Task Parallel Library from ASP.NET MVC project.
/*
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
Microsoft Open Technologies would like to thank its contributors, a list
of whom are at http://aspnetwebstack.codeplex.com/wikipage?title=Contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@itsff
itsff / magic.cs
Last active December 15, 2015 20:59
Drop your pants!
static void doMagic()
{
var form = new System.Windows.Forms.Form();
form.Text = "Drop your pants!";
form.Width = 800;
form.Height = 500;
var browser = new System.Windows.Forms.WebBrowser();
browser.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
browser.Size = form.Size;
browser.Navigate("http://www.youtube.com/embed/uIN48CE6L_I?autoplay=1");
@itsff
itsff / hello_bootstrap.html
Created August 1, 2013 19:15
Just messing around
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css">
struct my_element
{
int my_element_data;
/* Placement of container-specific node data can be easily modified for locality
optimization */
struct container__slist_node slist_node;
/* A single element can be linked into multiple containers */
struct container__hash_node hash_node;
@itsff
itsff / cpp_safe_buffer.cpp
Last active December 24, 2015 15:09
C++/CLI implementation of SafeBuffer class that wraps std::unique_ptr<const char*>. This allows for creation of UnmanagedMemoryStream and saves copying of data between the native and managed sides. I still need to figure out how to handle custom deleters.
ref class CppSafeBuffer : public ::System::Runtime::InteropServices::SafeBuffer
{
private:
// TODO: Figure out how to handle a custom deleter
//std::unique_ptr<const char*>::deleter_type _deleter;
public:
CppSafeBuffer(std::unique_ptr<const char*> && bytes,
const std::size_t size)
: ::System::Runtime::InteropServices::SafeBuffer(true)
@itsff
itsff / ui.java
Last active December 24, 2015 19:29
Android code generation
EditText name = (EditText)findViewById(R.id.name);
EditText address = (EditText)findViewById(R.id.address);
RadioGroup types = (RadioGroup)findViewById(R.id.types);
Button clear = (Button)findViewById(R.id.clear_button);