Skip to content

Instantly share code, notes, and snippets.

View pauldotknopf's full-sized avatar

Paul Knopf pauldotknopf

View GitHub Profile
@pauldotknopf
pauldotknopf / gist:8830358
Created February 5, 2014 18:44
FFMpegHelper.h
#pragma once
extern "C"
{
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#include <libavcodec\avcodec.h>
#include <libavformat\avformat.h>
}
@pauldotknopf
pauldotknopf / gist:8830397
Created February 5, 2014 18:46
FFMpegHelper.cpp
#include "stdafx.h"
#include "FFMpegHelper.h"
#include "get_extradata.h"
#include <iostream>
FFMpegHelper::FFMpegHelper(void)
{
}
FFMpegHelper::~FFMpegHelper(void)
@pauldotknopf
pauldotknopf / 0_reuse_code.js
Last active August 29, 2015 14:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pauldotknopf
pauldotknopf / gist:63a6b93bf84773bd99ac
Created March 25, 2015 08:10
Can't create a managed bootstrap installer

This is with version 3.9r2 (latest version)

I am having trouble creating a managed bootstrap installer. I followed the instructions I could find, and even referenced how you guys did it in your official wix installer exe.

The quick and dirty exception is coming from "src\ext\BalExtension\mba\host\host.cpp" on line 510.

hr = pAppFactory->Create(pEngine, pCommand, ppApplication);
ExitOnFailure(hr, "Failed to create the bootstrapper application.");
@pauldotknopf
pauldotknopf / gist:4049602
Created November 10, 2012 02:31
Unit testing with mongodb
class Program
{
static void Main(string[] args)
{
using(new MongoScope("9999"))
{
const string connectionString = "mongodb://localhost:9999/?safe=true";
var server = MongoServer.Create(connectionString);
var blog = server.GetDatabase("blog");
var posts = blog.GetCollection<Post>("posts");
### Keybase proof
I hereby claim:
* I am pauldotknopf on github.
* I am pauldotknopf (https://keybase.io/pauldotknopf) on keybase.
* I have a public key ASA_G--R5V-ybNvbkNnNLpJgzLMAfGaB4qfQkSPL8P18rgo
To claim this, I am signing this object:
package main
import (
"fmt"
"path/filepath"
"runtime"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
_ "github.com/docker/docker/daemon/graphdriver/register"
@pauldotknopf
pauldotknopf / arch-install
Last active January 28, 2018 20:30
My script to install Arch on my machines.
#!/bin/bash
set -e
parted -s /dev/sda \
mklabel gpt \
mkpart primary 1MiB 2GiB \
mkpart primary 2GiB 40GiB \
mkfs.fat /dev/sda1
@pauldotknopf
pauldotknopf / Example.cs
Last active December 21, 2018 12:53
Shared connections/transactions with AsyncLocal.
public async Task<Case> StartCase(int caseId, int userId)
{
using (var connection = new ConScope(_dataService))
using (var transaction = new TransScope())
{
// A transaction is used inside of the settings service as well.
// It uses the same "ConScope" and "TransScope" types internally,
// allowing us to share a single IDbConnection and IDbTransaction.
var caseContext = await _settingsService.GetSetting<CaseContext>();
if (caseContext.CurrentCaseId == caseId)
-- MySQL dump 10.13 Distrib 5.5.62, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: huginn_production
-- ------------------------------------------------------
-- Server version 5.5.62-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;