Skip to content

Instantly share code, notes, and snippets.

@pythoneer
pythoneer / gist:4518138
Last active March 13, 2016 23:59
meteor js with binary js
if (Meteor.isClient) {
Meteor.startup(function () {
loadbinaryjs();
var client = new BinaryClient('ws://localhost:9000');
client.on('stream', function(stream, meta){
var parts = [];
stream.on('data', function(data){
@pythoneer
pythoneer / gist:7117123
Created October 23, 2013 11:47
layout angular
<!DOCTYPE html>
<html ng-app>
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>
@pythoneer
pythoneer / receiver.cpp
Last active December 31, 2015 11:59
Zeroc Ice File Transfer Java to C++
#include <iostream>
#include <string>
#include <memory>
#include <fstream>
#include <Ice/Ice.h>
#include "send.h"
using namespace std;
Deps.autorun(function(){
Meteor.subscribe(name);
var cursor = collection.find(selector, options);
if(!scope.hasOwnProperty(name)){
scope[name] = collection.find(selector, options).fetch();
}
else{
cursor.forEach(function(meteorElement){
var wasFound = false;
#include<iostream>
#include<Eigen/Dense>
#include<Eigen/LU>
#include<vector>
using namespace std;
template<class PixelType>
class Framebuffer
{
protected:
@pythoneer
pythoneer / lerp
Created January 2, 2017 15:23
lerp
#RUST
//x0-x1 input range y0-y1 output range : x input cursor
pub fn lerp(x0: f32, x1: f32, y0: f32, y1: f32, x: f32) -> f32 {
y0 + (x - x0) * ((y1 - y0) / (x1 - x0))
}
@pythoneer
pythoneer / gist:3273f97ab00aeedba05c5c6aa3d05fda
Created February 13, 2017 11:28 — forked from leonardo-m/gist:6e9315a57fe9caa893472c2935e9d589
A selection of 101 LINQ Samples converted to Rust
// Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3.
#![feature(ordering_chaining, step_by)]
fn main() {
// linq5: Where - Indexed
/*
//c#
public void Linq5()
{
@pythoneer
pythoneer / Combiner.java
Last active April 14, 2017 18:37
Cartesian product of to iterators
package javaapplication4;
import java.util.Iterator;
public class JavaApplication4 {
public static class ClassA {
public int getAId() {
return 1;
}
@pythoneer
pythoneer / Main.java
Created August 2, 2017 17:32
java_generic_reflection
import java.lang.reflect.Field;
public class Main {
//a container holding all kinds of stuff
interface Container<F,M,L> {
boolean contains(F f, M m, L l);
F first();
M middle();
L last();
@pythoneer
pythoneer / Main.java
Last active August 2, 2017 18:23
java_generic_concrete
public class Main {
//a container holding all kinds of stuff
interface Container<F,M,L> {
boolean contains(F f, M m, L l);
F first();
M middle();
L last();
}