Skip to content

Instantly share code, notes, and snippets.

View jkuri's full-sized avatar
🏠
Working from home

Jan Kuri jkuri

🏠
Working from home
View GitHub Profile
var pkg = require('./package.json');
var path = require('path');
var Builder = require('systemjs-builder');
var name = pkg.name;
var builder = new Builder();
var config = {
baseURL: '.',
transpiler: 'typescript',
typescriptOptions: {
{
"name": "proj",
"version": "0.0.0",
"license": "Apache-2.0",
"angular-cli": {
"packages": [
{
"name": "jquery",
"version": "2.2.1"
},
Typescript found the following errors:
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (8,32): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (13,35): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (14,37): Property 'toBe' does not exist on type 'NgMatchers'.
Error: Typescript found the following errors:
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (8,32): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (13,35): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (14,37): Property 'toBe' does not exist on type 'NgMatchers'.
at TSPlugin.build.rootFileNames.forEach.Obj
const options = require(path.resolve(process.cwd(), 'src', 'tsconfig.json')).compilerOptions;
const tsOpts = ts.parseJsonConfigFileContent({ compilerOptions: options, files: [] }, null, null).options;
const tsFiles = glob.sync('**/*.ts', {
cwd: path.resolve(process.cwd(), 'src')
});
const tsServiceHost = new ServiceHost(tsOpts, tsFiles, tsFiles);
const tsService = ts.createLanguageService(tsServiceHost, ts.createDocumentRegistry());
const output = tsFiles.map(file => {
return tsService.getEmitOutput(file);
});
@jkuri
jkuri / system-js-bundler-vendor.js
Created February 7, 2016 08:19
SystemJS build script for Angular2 with vendor included
var pkg = require('./package.json');
var path = require('path');
var Builder = require('systemjs-builder');
var name = pkg.name;
var builder = new Builder();
var config = {
baseURL: '.',
transpiler: 'typescript',
typescriptOptions: {
@jkuri
jkuri / animate_values.js
Created August 24, 2017 04:28 — forked from XerxesNoble/animate_values.js
Basic javascript linear value animation that can accept easing functions and provides update & complete callbacks
/**
* @desc Basic linear value animation that can accept simple easing functions and provides update & complete callbacks
* @param {Object} values - Object with numerical values. eg. { value1: 0, value2: 20, someKey: 55 }
* @param {Number} duration - How long (in milliseconds) the animation will be
* @param {Object} options - target values, update callback & complete callback
* @param {Function} [options.onComplete=(values) => values] - Callback that fires once animation is complete
* @param {Function} [options.onUpdate=(values) => values] - Callback that fires when animation frame updates
* @param {Function} [options.ease=(t) => t] - easing method eg. https://gist.github.com/gre/1650294
* @example
*
@jkuri
jkuri / README
Created October 20, 2017 08:51 — forked from rkusa/README
Install alpine linux on xhyve VM
# curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86_64/alpine-3.3.1-x86_64.iso
curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86/alpine-3.3.1-x86.iso
# create hdd image (8GB)
dd if=/dev/zero of=hdd.img bs=1g count=8
# extract kernel and initramfs
brew install cdrtools
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/initramfs-grsec > initramfs-grsec
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/vmlinuz-grsec > vmlinuz-grsec
@jkuri
jkuri / proxy.go
Created November 16, 2017 16:20 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@jkuri
jkuri / tcp_server.c
Created December 26, 2017 11:53 — forked from oleksiiBobko/tcp_server.c
Simple socket server in C using threads (pthread library) Compiles on linux
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>
@jkuri
jkuri / cv2ff.cpp
Created January 16, 2018 05:58 — forked from yohhoy/cv2ff.cpp
Convert from OpenCV image and write movie with FFmpeg
/*
* Convert from OpenCV image and write movie with FFmpeg
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>