Skip to content

Instantly share code, notes, and snippets.

View mika76's full-sized avatar
🤖
Coding...

Mladen Mihajlović mika76

🤖
Coding...
  • Serbia
  • 21:10 (UTC +02:00)
View GitHub Profile
@mika76
mika76 / gist:275f2cac9b856a2b0b7c
Created March 13, 2015 12:06
C3.JS Knockout bindings
ko.bindingHandlers.chartColumns = {
init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
var columns = ko.unwrap(valueAccessor()),
options = ko.unwrap(allBindings.get('chartOptions')) || {};
options = $.extend(true, options, {
bindto: element,
data: {
columns: columns
}
@mika76
mika76 / gist:691a32cb6a4711f6390f
Last active August 29, 2015 14:17
Knockout custom binding for jQuery Knob http://anthonyterrien.com/knob/
// https://github.com/aterrien/jQuery-Knob/issues/209
ko.bindingHandlers.knob = {
init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
var local = ko.utils.unwrapObservable(valueAccessor()),
options = {};
ko.utils.extend(options, ko.bindingHandlers.knob.options);
ko.utils.extend(options, allBindings.get('knobOptions'));
$(element)
//
// BitwiseOptions.swift
//
// Created by Gregory Higley on 11/24/14.
// Copyright (c) 2014 Prosumma LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@mika76
mika76 / teamviewer.bat
Last active November 10, 2017 01:31 — forked from p4ul/teamviewer.bat
use this with my teamviewer:// protocol hander
@echo off
REM place this in C:\ and install teamviewer.reg below. Then you should be able to
REM openteamviewers from the webbrowser with teamviewer://1234
set protocolString=%1
REM uncomment below for testing
REM set protocolString="teamviewer://795143153"
set protocolString=%protocolString:"=%
@mika76
mika76 / dataview-polyfill.js
Created September 26, 2015 21:27
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
void function(global){
if ('DataView' in global && 'ArrayBuffer' in global) {
return;
}
var hide = (function(){
// check if we're in ES5
if (typeof Object.getOwnPropertyNames === 'function' && !('prototype' in Object.getOwnPropertyNames)) {
var hidden = { enumerable: false };
@mika76
mika76 / TinyTween.cs
Created April 12, 2016 21:41
A single file tween library in C# with support built in for XNA and Unity data types. MIT License.
// TinyTween.cs
//
// Copyright (c) 2013 Nick Gravelyn
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@mika76
mika76 / Spaceship.cs
Created April 15, 2016 18:31 — forked from MikeGringauz/Spaceship.cs
TinyTween engine adopted to Duality 2D game engine with sample Spaceship component demo.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Duality;
using Duality.Components.Physics;
using Duality.Components.Renderers;
using Duality.Input;
using TinyTween;
@mika76
mika76 / msbuild.xml
Last active June 24, 2016 06:01
Replacement for HeatDirectory since heat.exe throws a BadImageFormatException when running msbuild in 64 bit
<UsingTask
TaskName="CustomHeatDirectory"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
<ParameterGroup>
<Directory Required="true" />
<DirectoryRefId Required="true" />
<ComponentGroupName Required="true" />
<OutputFile Required="true" />
<GenerateGuidsNow Required="true" />
@mika76
mika76 / RxTcpServer.cs
Created September 11, 2016 07:22 — forked from micahasmith/RxTcpServer.cs
rx c# tcp server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Data;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using System.Reactive.Linq;
@mika76
mika76 / spy.cs
Last active September 11, 2016 07:29
rx spy
//from http://stackoverflow.com/questions/20220755/how-can-i-see-what-my-reactive-extensions-query-is-doing/20220756#20220756
public static IObservable<T> Spy<T>(this IObservable<T> source, string opName = null)
{
opName = opName ?? "IObservable";
Console.WriteLine("{0}: Observable obtained on Thread: {1}",
opName,
Thread.CurrentThread.ManagedThreadId);
return Observable.Create<T>(obs =>