Skip to content

Instantly share code, notes, and snippets.

View martinlindhe's full-sized avatar
😸

Martin Lindhe martinlindhe

😸
View GitHub Profile
/*! angular-google-maps 1.1.6 2014-06-28
* AngularJS directives for Google Maps
* git: https://github.com/nlaplante/angular-google-maps.git
*/
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
@martinlindhe
martinlindhe / Behat3Test.php
Last active October 30, 2018 23:39
run Behat 3 tests as a phpunit script (to include behat in code coverage count)
<?php
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Behat\Behat\ApplicationFactory;
class BehatTest extends TestCase
{
/**
* @group Behat
<template>
<div v-for="lang in languages">
<language :name="lang.name" :code="lang.code"></language>
{{ $t('nav.about') }}
</div>
</template>
<script>
import Vue from 'vue';
@martinlindhe
martinlindhe / min.php
Last active November 19, 2015 12:10
99 bottles
# 208 bytes
$b=99;$d=" bottles of beer";$c="$d on the wall";do{echo "$b$c, $b$d.\n";if(!--$b){echo "Go to the store and buy some more";$b=99;}else echo "Take one down and pass it around";echo ", $b$c.\n\n";}while($b<99);
@martinlindhe
martinlindhe / Alert.vue
Last active May 19, 2022 14:31
jasmine + karma for vue test
<style>
.Alert {
padding: 2em;
}
.Alert-Success {
border: 10px solid green;
}
.Alert-Error {
border: 10px solid red;
}
@martinlindhe
martinlindhe / day1.go
Created December 1, 2015 13:02
advent of code - day 1
package aoc
func CalcFloor(s string) int {
res := 0
for i := 0; i < len(s); i++ {
if s[i] == '(' {
res++
} else if s[i] == ')' {
res--
@martinlindhe
martinlindhe / Interpreter.php
Last active December 1, 2015 16:18
brainfuck php
<?php namespace MartinLindhe\Brainfuck;
class Interpreter
{
protected $cells;
protected $pointer = 0;
public function exec($s)
{
@martinlindhe
martinlindhe / aoc1-1.asm
Created December 3, 2015 09:58
advent of code 1.1 in BSD (osx) assembly
section .text
global mystart
int_to_string:
add esi,9
mov byte [esi],0
mov ebx,10
.next:
@martinlindhe
martinlindhe / day6.go
Created December 7, 2015 10:42
aoc 6 in go
package aoc
import (
"fmt"
"regexp"
"strconv"
)
func newChristmasLightsPart2() [1000][1000]int {
// 1 million lights in a 1000x1000 grid
@martinlindhe
martinlindhe / day7.go
Last active December 8, 2015 11:34
aoc day 7.1
package aoc
import (
"fmt"
"regexp"
"strconv"
"strings"
)
func makeCircuit(s string) map[string]string {