Skip to content

Instantly share code, notes, and snippets.

View jrosskopf's full-sized avatar

Joachim Rosskopf jrosskopf

View GitHub Profile
app.config(function($httpProvider) {
$httpProvider.interceptors.push(function($rootScope, $location, $q) {
return {
'request': function(request) {
// if we're not logged-in to the AngularJS app, redirect to login page
$rootScope.loggedIn = $rootScope.loggedIn || $rootScope.username;
if (!$rootScope.loggedIn && $location.path() != '/login') {
$location.path('/login');
}
return request;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MassTransit.AutomatonymousTests
{
using System.Threading;
using Automatonymous;
using Magnum.Extensions;
marker {
stroke: #666;
fill: #666;
overflow: visible;
}
path.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
@jrosskopf
jrosskopf / ffac.c
Created April 20, 2012 14:41
03_ffac
#include <assert.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
typedef unsigned long long ullong;
typedef struct {
int count;
@jrosskopf
jrosskopf / dataflow.php
Created April 5, 2012 10:45
DataFlow CLI interface
<?php
/*
error_reporting(E_ALL | E_STRICT);
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
*/
require_once 'abstract.php';
@jrosskopf
jrosskopf / CustomSqlServerOrmLiteDialectProvider.cs
Created February 20, 2012 16:42
CustomSqlServerOrmLiteDialectProvider.cs
namespace ServiceStack.OrmLite.CustomSqlServer
{
public class CustomSqlServerOrmLiteDialectProvider : SqlServerOrmLiteDialectProvider
{
public new static CustomSqlServerOrmLiteDialectProvider Instance = new CustomSqlServerOrmLiteDialectProvider();
private const string VARIABLE_CHARACTER = "@";
public void PrepareForInsertRowStatement(object objWithProperties, System.Data.IDbCommand command)
{
@jrosskopf
jrosskopf / Makefile
Created January 23, 2012 15:04
14_dups
CFLAGS = -Wall -g -std=gnu99
LFLAGS = -R/usr/local/lib -lm
SHARED = -fPIC -shared
CC = gcc
DEPENDFILE = .dependencies
SRC = dups.c hashtable.c
SHSRC =
OBJ = $(SRC:%.c=%.o)
SHOBJ = $(SHSRC:%.c=%.so)
@jrosskopf
jrosskopf / bot_karl.c
Created January 23, 2012 15:01
13_four
#include "bot_karl.h"
bool bot_karl_ready_to_work = false;
void intialize_bot_karl(pt_four_wins_ctx ctx) {
//printf("Bot Karl intialized\n");
srand(time(NULL));
bot_karl_ready_to_work = true;
}
@jrosskopf
jrosskopf / reverse2.c
Created January 8, 2012 13:03
12_reverse2
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define EOL '\n'
#define DEFAULT_LINE_BUFFER_LENGTH 1024
#define DEFAULT_LINE_BUFFER_INCREMENT DEFAULT_LINE_BUFFER_LENGTH
@jrosskopf
jrosskopf / reverse.c
Created December 21, 2011 11:42
11_reverse
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DEFAULT_LINE_BUFFER_LENGTH 1024
#define DEFAULT_LINE_BUFFER_INCREMENT DEFAULT_LINE_BUFFER_LENGTH
#define ARG_IS_NOT_SEARCH_WORD "-x"