Skip to content

Instantly share code, notes, and snippets.

<Window x:Class="MySample.MyCoolWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Button x:Name="ClearButton">Clear</Button>
</Grid>
</Window>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:x="http://filipfracz.net/schemas/android_extensions/1.0"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
x:package="net.filipfracz.samples"
x:className="MainActivityLayoutHelper">
// During init
final MainActivityHelper ui = new MainActivityHelper(this);
// ----------------------------------------
// Old usage
Button save_button = (Button) findViewById(R.id.save);
save_button.setOnClickListener(onSave);
// ----------------------------------------
// ... all necessary imports ...
package net.filipfracz.samples;
class MainActivityHelper
{
public EditText name;
public Button save_button;
public MainActivityHelper(Context context)
@itsff
itsff / build.mk
Last active August 29, 2015 14:01
shitty algo
name = my_shitty_so_algo
lang = c
type = shared
c_compiler_flags = -Wno-unused-parameter
include_paths = ../algo/ttsdk/include
source = main.c
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Interview Questions</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
@itsff
itsff / edge.py
Last active August 29, 2015 14:05
Python EdgeServer client
import websocket
import json
import requests
import base64
def get_access_token(username, password, auth_url="https://id.ttstage.com/oauth/token"):
login_payload = {'grant_type': 'password', 'username': username, 'password': password}
auth = base64.b64encode("b7b9974e8e2244e387ab64cadd0d667a:830b5b391b474a4780a8697d0396a27762aa40367e8549578ae71149df8c78c5")
@itsff
itsff / example.hpp
Created August 26, 2014 21:14
Eugene
extern "C"
{
#define restrict __restrict
#include <ttsdk/whatever.h>
#include <ttsdk/order.h>
// ...
#include <fcntl.h>
@itsff
itsff / CME_PIT_Feed
Last active August 29, 2015 14:13
Graph defined in terms of its outputs
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<key attr.name="label" attr.type="string" for="node" id="label"/>
<key attr.name="Edge Label" attr.type="string" for="edge" id="edgelabel"/>
<key attr.name="weight" attr.type="double" for="edge" id="weight"/>
<key attr.name="Edge Id" attr.type="string" for="edge" id="edgeid"/>
<key attr.name="r" attr.type="int" for="node" id="r"/>
<key attr.name="g" attr.type="int" for="node" id="g"/>
<key attr.name="b" attr.type="int" for="node" id="b"/>
<key attr.name="x" attr.type="float" for="node" id="x"/>
@itsff
itsff / HowToUseJIT.cpp
Created January 21, 2015 17:44
Copy of LLVM example code on how to use LLVM JIT
//
// Original URL: https://llvm.org/svn/llvm-project/llvm/trunk/examples/HowToUseJIT/HowToUseJIT.cpp
//
//===-- examples/HowToUseJIT/HowToUseJIT.cpp - An example use of the JIT --===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//