Skip to content

Instantly share code, notes, and snippets.

import QtQuick 2.3
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0
import QtQuick.Controls 1.1
ApplicationWindow {
id: root
width: 540
height: 420
color: "black"
@segphault
segphault / IntroLayer.cs
Created August 7, 2013 20:33
Attempting to make a bouncing ball with Cocos2D XNA and Box2D
using System;
using Cocos2D;
using Box2D.Dynamics;
using Box2D.Common;
using Box2D.Collision.Shapes;
using Microsoft.Xna.Framework;
@segphault
segphault / LeapController.cs
Created July 26, 2013 23:46
Using the Leap Motion controller in a Xamarin.Mac application.
using System;
using System.Drawing;
using MonoMac.Foundation;
using MonoMac.AppKit;
using Leap;
namespace XamMacLeap
{
@segphault
segphault / signalrmonohack.diff
Created May 2, 2013 20:53
A patch for commenting out the performance counters in SignalR so that it will compile under Mono
diff --git a/src/Microsoft.AspNet.SignalR.Core/Messaging/MessageBroker.cs b/src/Microsoft.AspNet.SignalR.Core/Messaging/MessageBroker.cs
index 76c2416..eb36a38 100644
--- a/src/Microsoft.AspNet.SignalR.Core/Messaging/MessageBroker.cs
+++ b/src/Microsoft.AspNet.SignalR.Core/Messaging/MessageBroker.cs
@@ -19,7 +19,7 @@ public class MessageBroker : IDisposable
{
private readonly Queue<ISubscription> _queue = new Queue<ISubscription>();
- private readonly IPerformanceCounterManager _counters;
+ //private readonly IPerformanceCounterManager _counters = null;
@segphault
segphault / GReader.cs
Created March 11, 2013 21:18
A quick and dirty Google Reader client implementation built in C# with Xamarin using the new async support.
using System;
using System.Net;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using SQLite;
@segphault
segphault / huetest.py
Created November 29, 2012 07:26
Adjust brightness of Hue bulb
import json, urllib2
CLIENT_IP = "xxxx"
CLIENT_ID = "xxxx"
def build_url(endpoint):
return "http://{0}/api/{1}/{2}".format(CLIENT_IP, CLIENT_ID, endpoint)
def send(endpoint, value):
url = build_url(endpoint)
@segphault
segphault / videotest.html
Created June 5, 2012 06:13
HTML5 photo booth with live sepia filter
<html>
<head>
<title>HTML5 Photo Booth</title>
<style>
#live {
-webkit-filter: sepia(0.8);
}
</style>
</head>
<body>
@segphault
segphault / chrome.scpt
Created May 22, 2012 21:26
Launch a new Chrome Incognito window on the current space
tell application "Google Chrome"
make new window with properties {mode:"incognito"}
tell application "System Events" to set frontmost of process "Google Chrome" to true
end tell
@segphault
segphault / nav.vim
Created March 19, 2012 02:48
Improve Vim navigation bindings for wrapped text
" Override Vim's navigational keys
" To support better navigation when wrapping is enabled
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
@segphault
segphault / extreddit.js
Created March 6, 2012 22:19
Create an Ext JS store that processes data from Reddit's JSON API
Ext.define('MyApp.store.base.RedditStore', {
extend: 'Ext.data.Store',
config: {
storeId: 'MyJsonPStore',
proxy: {
type: 'jsonp',
url: 'http://www.reddit.com/hot.json',
callbackKey: 'jsonp',
reader: {