Skip to content

Instantly share code, notes, and snippets.

View svdoever's full-sized avatar

Serge van den Oever svdoever

View GitHub Profile
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Microsoft.LightSwitch.Framework.Client;
using LightSwitch = Microsoft.LightSwitch.Model.Storage;
using Microsoft.LightSwitch.Model;
using System.Runtime.InteropServices.Automation;
namespace ODataFinderLibrary
@svdoever
svdoever / localstorage.ts
Created September 13, 2014 20:51
LocalStorage service for AngularJS using TypeScript
/// <reference path='../_reference.ts'/>
module ft {
"use strict";
export class LocalStorageService {
// TODO: Need to handle QUOTA_EXCEEDED_ERR
public static $inject = [
"$log"
@svdoever
svdoever / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-quiz-view.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../paper-calculator/paper-calculator.html">
@svdoever
svdoever / git-branches.ps1
Last active June 9, 2016 15:18
Show the git branch status of all subfolders in a given path
param($path = (Get-Item -Path ".\" -Verbose).FullName)
Write-Host "Processing for git branch status of subfolders in folder: $path"
$items = @()
Get-ChildItem -Path $path | ?{$_.PSIsContainer } | Foreach-Object -Process {
if (Test-Path -Path (Join-Path -Path $_.FullName -ChildPath '.git')) {
pushd $_.FullName
Write-Host "Processing $($_)...."
git fetch
@svdoever
svdoever / MassTransitRequestResponse.cs
Created August 29, 2016 15:44
Working example of MassTransit 3 request/response conversation
using System;
using System.Threading;
using System.Threading.Tasks;
using MassTransit;
using Xunit;
namespace MassTransitRequestResponse.Test
{
public interface INamedReq
{
@svdoever
svdoever / index.js
Created April 16, 2018 21:20
Hypernova server implementation suporting async rendering
// hypernova server implementation with support for async react components
// Serge van den Oever, Macaw
//
// If the hypernova server is run from iisnode we can access the appsettings in the web.config as
// environment variable, i.e.
// <configuration><appSettings><add key="GLOBAL_PREFIX" value="somevalue"></appSettings>...
// then use var globalPrefix = process.env.GLOBAL_PREFIX; to access the setting
// Example post body:
// {
@svdoever
svdoever / hypernova-react-async-redux.tsx
Created April 16, 2018 21:27
Utility functions for creating an async hypernova component
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as ReactDOMServer from 'react-dom/server';
import { Provider } from 'react-redux';
import hypernova, { serialize, load } from 'hypernova';
import { Store } from 'redux';
export const renderReactAsyncReduxServer = (name: string, C: React.ComponentClass, store: Store<any>) => hypernova({
server() {
return (props: any) => {
@svdoever
svdoever / youtube2mp4.js
Created June 1, 2018 21:36
NodeJS Express service to convert YouTube url to mp4 url
const axios = require('axios');
const express = require('express');
// from https://codewithmark.com/learn-to-create-youtube-video-downloader
function qsToJson(qs) {
var res = {};
var pars = qs.split('&');
var kv, k, v;
for (i in pars) {
kv = pars[i].split('=');
@svdoever
svdoever / youtube2mp4.js
Last active March 17, 2021 02:32
NodeJS Express service to convert YouTube url to mp4 url
const axios = require('axios');
const express = require('express');
// from https://codewithmark.com/learn-to-create-youtube-video-downloader
function qsToJson(qs) {
var res = {};
var pars = qs.split('&');
var kv, k, v;
for (i in pars) {
kv = pars[i].split('=');
@svdoever
svdoever / amp-list-video-story.json
Created June 4, 2018 10:37
Sample json file with an mp4 video over https for amp-list testing
{
"url":"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WhatCarCanYouGetForAGrand.mp4"
}