Skip to content

Instantly share code, notes, and snippets.

View vojto's full-sized avatar
🎯
Focusing

Vojtech Rinik vojto

🎯
Focusing
  • Kosice, Slovakia
  • 14:24 (UTC -12:00)
  • X @_vojto
View GitHub Profile
# Oddelenie
entity Oddelenie {
nazov : string required, length 5 30
kod : string required, length 1 4
uroven : real
}
# Zamestnanec
entity Zamestnanec {
meno : string required, length 2 30
@vojto
vojto / gist:5186687
Created March 18, 2013 11:57
Python script that will create a mix for interval running
import os
import re
from echonest.remix.action import render
import echonest.remix.audio as audio
FIRST_SLOW_TIME = 180
SLOW_TIME = 90
FAST_TIME = 60
#!/usr/bin/env node
'use strict';
var cmd = function () {
var request = require('request'),
async = require('async'),
@vojto
vojto / Data.cs
Created September 28, 2016 08:41
public static Int64 GetTimeStamp(
int year, int month, int day,
int hour, int minute, int second, int milliseconds)
{
Int64 timestamp = DateToTicks(year, month, day)
+ TimeToTicks(hour, minute, second);
return timestamp + milliseconds * TicksInMillisecond;
}
// Pick
public extension SignalProducer where Value: OptionalProtocol {
func pick<T>(picking: @escaping ((Value.Wrapped) -> (SignalProducer<T?, Error>))) -> SignalProducer<T?, Error> {
return self.flatMap(.latest) { value -> SignalProducer<T?, Error> in
if let value = value.optional {
return picking(value)
} else {
return SignalProducer<T?, Error>(value: nil)
}
:set shiftwidth=2
:set tabstop=2
:set guifont=Hack:h12
:set nofoldenable
colorscheme OceanicNext
map <F12> mzgg=G`z
map <D-/> gcc
import React from "react";
import {Stage} from "@inlet/react-pixi";
export const Graph: React.FC<{
nodes: Node[];
edges: Edge[];
}> = (props) => {
return (
<Stage>
{props.edges.map((edge) => {
import React from "react";
import {Circle} from "./Primitives";
import {Container} from "@inlet/react-pixi";
export const NodeView: React.FC<{node: Node}> = (props) => {
return (
<Container x={props.node.x} y={props.node.y}>
<Circle x={0} y={0} radius={20} color={0x0000ff} />
</Container>
);
import { Graphics } from 'pixi.js';
import { PixiComponent, Stage } from '@inlet/react-pixi';
const Rectangle = PixiComponent('Rectangle', {
create: props => new Graphics(),
applyProps: (instance, _, props) => {
const { x, y, width, height, fill, alpha } = props;
instance.clear();
instance.beginFill(fill);
instance.clear();
instance.beginFill(fill);
instance.drawRect(x, y, width, height);
instance.endFill();
instance.alpha = alpha;